| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682 |
- // SPDX-License-Identifier: Apache-2.0
- /*
- * Copyright (C) 2014 Intel Corporation
- *
- */
- #define _GNU_SOURCE
- #include <stdbool.h>
- #include "emulator/bthost.h"
- #include "lib/bluetooth.h"
- #include "src/shared/util.h"
- #include "src/shared/tester.h"
- #include "src/shared/queue.h"
- #include "tester-main.h"
- #define ATT_HANDLE_SIZE 2
- #define L2CAP_ATT_ERROR 0x01
- #define L2CAP_ATT_EXCHANGE_MTU_REQ 0x02
- #define L2CAP_ATT_EXCHANGE_MTU_RSP 0x03
- #define L2CAP_ATT_FIND_BY_TYPE_REQ 0x06
- #define L2CAP_ATT_READ_REQ 0x0a
- #define L2CAP_ATT_READ_RSP 0x0b
- #define L2CAP_ATT_WRITE_REQ 0x12
- #define L2CAP_ATT_WRITE_RSP 0x13
- #define L2CAP_ATT_HANDLE_VALUE_NOTIFY 0x1b
- #define L2CAP_ATT_HANDLE_VALUE_IND 0x1d
- #define GATT_STATUS_SUCCESS 0x00000000
- #define GATT_STATUS_FAILURE 0x00000101
- #define GATT_STATUS_INS_AUTH 0x08
- #define GATT_ERR_INVAL_ATTR_VALUE_LEN 0x0D
- #define GATT_SERVER_DISCONNECTED 0
- #define GATT_SERVER_CONNECTED 1
- #define APP1_ID 1
- #define APP2_ID 2
- #define CONN1_ID 1
- #define CONN2_ID 2
- #define TRANS1_ID 1
- #define BT_TRANSPORT_UNKNOWN 0x00
- #define GATT_SERVER_TRANSPORT_LE 0x01
- #define GATT_SERVER_TRANSPORT_BREDR 0x02
- #define GATT_SERVER_TRANSPORT_LE_BREDR (0x01 | 0x02)
- #define GATT_WRITE_TYPE_NO_RESPONSE 0x01
- #define GATT_WRITE_TYPE_DEFAULT 0x02
- #define GATT_WRITE_TYPE_PREPARE 0x03
- #define GATT_WRITE_TYPE_SIGNED 0x04
- #define CHAR_PROP_BROADCAST 0x01
- #define CHAR_PROP_READ 0x02
- #define CHAR_PROP_WRITE_WITHOUT_RESPONSE 0x04
- #define CHAR_PROP_WRITE 0x08
- #define CHAR_PROP_NOTIFY 0x10
- #define CHAR_PROP_INDICATE 0x20
- #define CHAR_PROP_AUTHENTICATED_SIGNED_WRITES 0x40
- #define CHAR_PROP_EXTENDED_PROPERTIES 0x80
- #define CHAR_PERM_READ 0x0001
- #define CHAR_PERM_READ_ENCRYPTED 0x0002
- #define CHAR_PERM_READ_ENCRYPTED_MITM 0x0004
- #define CHAR_PERM_WRITE 0x0010
- #define CHAR_PERM_WRITE_ENCRYPTED 0x0020
- #define CHAR_PERM_WRITE_ENCRYPTED_MITM 0x0040
- #define CHAR_PERM_WRITE_SIGNED 0x0080
- #define CHAR_PERM_WRITE_SIGNED_MITM 0x0100
- static struct queue *list; /* List of gatt test cases */
- static uint16_t srvc1_handle;
- static uint16_t inc_srvc1_handle;
- static uint16_t char1_handle;
- static struct iovec char1_handle_v = {
- .iov_base = &char1_handle,
- .iov_len = sizeof(char1_handle),
- };
- struct set_att_data {
- char *to;
- char *from;
- int len;
- };
- struct att_write_req_data {
- uint16_t *attr_handle;
- uint8_t *value;
- };
- static bt_uuid_t app1_uuid = {
- .uu = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
- };
- static bt_uuid_t app2_uuid = {
- .uu = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 },
- };
- static uint8_t value_1[] = {0x01};
- static uint8_t att_write_req_value_1[] = {0x00, 0x01, 0x02, 0x03};
- static struct iovec att_write_req_value_1_v = {
- .iov_base = att_write_req_value_1,
- .iov_len = sizeof(att_write_req_value_1),
- };
- struct gatt_connect_data {
- const int app_id;
- const int conn_id;
- };
- struct gatt_search_service_data {
- const int conn_id;
- bt_uuid_t *filter_uuid;
- };
- struct get_char_data {
- const int conn_id;
- btgatt_srvc_id_t *service;
- };
- struct get_desc_data {
- const int conn_id;
- btgatt_srvc_id_t *service;
- btgatt_gatt_id_t *characteristic;
- btgatt_gatt_id_t *desc;
- };
- struct get_incl_data {
- const int conn_id;
- btgatt_srvc_id_t *service;
- btgatt_srvc_id_t *start_service;
- };
- struct read_char_data {
- const int conn_id;
- btgatt_srvc_id_t *service;
- btgatt_gatt_id_t *characteristic;
- int auth_req;
- };
- struct read_desc_data {
- const int conn_id;
- btgatt_srvc_id_t *service;
- btgatt_gatt_id_t *characteristic;
- btgatt_gatt_id_t *descriptor;
- int auth_req;
- };
- struct write_char_data {
- int conn_id;
- btgatt_srvc_id_t *service;
- btgatt_gatt_id_t *characteristic;
- int write_type;
- int len;
- int auth_req;
- char *p_value;
- };
- struct write_desc_data {
- int conn_id;
- btgatt_srvc_id_t *service;
- btgatt_gatt_id_t *characteristic;
- btgatt_gatt_id_t *descriptor;
- int write_type;
- int len;
- int auth_req;
- char *p_value;
- };
- struct notif_data {
- int conn_id;
- const bt_bdaddr_t *bdaddr;
- btgatt_srvc_id_t *service;
- btgatt_gatt_id_t *charac;
- };
- struct add_service_data {
- int app_id;
- btgatt_srvc_id_t *service;
- int num_handles;
- };
- struct add_included_service_data {
- int app_id;
- uint16_t *inc_srvc_handle;
- uint16_t *srvc_handle;
- };
- struct add_char_data {
- int app_id;
- uint16_t *srvc_handle;
- bt_uuid_t *uuid;
- int properties;
- int permissions;
- };
- struct add_desc_data {
- int app_id;
- uint16_t *srvc_handle;
- bt_uuid_t *uuid;
- int permissions;
- };
- struct start_srvc_data {
- int app_id;
- uint16_t *srvc_handle;
- int transport;
- };
- struct stop_srvc_data {
- int app_id;
- uint16_t *srvc_handle;
- };
- struct delete_srvc_data {
- int app_id;
- uint16_t *srvc_handle;
- };
- struct send_indication_data {
- int app_id;
- uint16_t *attr_handle;
- int conn_id;
- int len;
- int confirm;
- char *p_value;
- };
- struct send_resp_data {
- int conn_id;
- int trans_id;
- int status;
- btgatt_response_t *response;
- };
- static bt_bdaddr_t emu_remote_bdaddr_val = {
- .address = { 0x00, 0xaa, 0x01, 0x01, 0x00, 0x00 },
- };
- static bt_device_type_t emu_remote_ble_device_type = BT_DEVICE_DEVTYPE_BLE;
- static bt_property_t prop_emu_remotes_default_set[] = {
- { BT_PROPERTY_BDADDR, sizeof(emu_remote_bdaddr_val),
- &emu_remote_bdaddr_val },
- };
- static bt_property_t prop_emu_remotes_default_le_set[] = {
- { BT_PROPERTY_BDADDR, sizeof(emu_remote_bdaddr_val),
- &emu_remote_bdaddr_val },
- { BT_PROPERTY_TYPE_OF_DEVICE, sizeof(bt_device_type_t),
- &emu_remote_ble_device_type },
- };
- static struct bt_action_data prop_test_remote_ble_bdaddr_req = {
- .addr = &emu_remote_bdaddr_val,
- .prop_type = BT_PROPERTY_BDADDR,
- .prop = &prop_emu_remotes_default_set[0],
- };
- static bt_scan_mode_t setprop_scan_mode_conn_val =
- BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE;
- static bt_property_t prop_test_scan_mode_conn = {
- .type = BT_PROPERTY_ADAPTER_SCAN_MODE,
- .val = &setprop_scan_mode_conn_val,
- .len = sizeof(setprop_scan_mode_conn_val),
- };
- static struct emu_l2cap_cid_data cid_data;
- static struct gatt_connect_data app1_conn_req = {
- .app_id = APP1_ID,
- .conn_id = CONN1_ID,
- };
- static struct gatt_connect_data app1_conn2_req = {
- .app_id = APP1_ID,
- .conn_id = CONN2_ID,
- };
- static struct gatt_connect_data app2_conn_req = {
- .app_id = APP2_ID,
- .conn_id = CONN2_ID,
- };
- static struct gatt_search_service_data search_services_1 = {
- .conn_id = CONN1_ID,
- .filter_uuid = NULL,
- };
- static const struct iovec exchange_mtu_req_pdu = raw_pdu(0x02, 0xa0, 0x02);
- static const struct iovec exchange_mtu_resp_pdu = raw_pdu(0x03, 0xa0, 0x02);
- static struct bt_action_data bearer_type = {
- .bearer_type = BDADDR_LE_PUBLIC,
- };
- static btgatt_srvc_id_t service_1 = {
- .is_primary = true,
- .id = {
- .inst_id = 0,
- .uuid.uu = {0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80,
- 0x00, 0x10, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00}
- }
- };
- static btgatt_srvc_id_t service_2 = {
- .is_primary = true,
- .id = {
- .inst_id = 1,
- .uuid.uu = {0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80,
- 0x00, 0x10, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00},
- }
- };
- static btgatt_srvc_id_t service_add_1 = {
- .is_primary = true,
- .id = {
- .inst_id = 0,
- .uuid.uu = {0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80,
- 0x00, 0x10, 0x00, 0x00, 0xFF, 0xEF, 0x00, 0x00},
- }
- };
- static btgatt_srvc_id_t service_add_2 = {
- .is_primary = true,
- .id = {
- .inst_id = 1,
- .uuid.uu = {0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80,
- 0x00, 0x10, 0x00, 0x00, 0xFF, 0xDF, 0x00, 0x00},
- }
- };
- static btgatt_srvc_id_t service_add_3 = {
- .is_primary = true,
- .id = {
- .inst_id = 2,
- .uuid.uu = {0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80,
- 0x00, 0x10, 0x00, 0x00, 0xFF, 0xCF, 0x00, 0x00},
- }
- };
- static btgatt_srvc_id_t included_1 = {
- .is_primary = false,
- .id = {
- .inst_id = 1,
- .uuid.uu = {0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80,
- 0x00, 0x10, 0x00, 0x00, 0xff, 0xfe, 0x00, 0x00},
- }
- };
- static btgatt_srvc_id_t included_2 = {
- .is_primary = false,
- .id = {
- .inst_id = 1,
- .uuid.uu = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10},
- }
- };
- static btgatt_gatt_id_t characteristic_1 = {
- .inst_id = 1,
- .uuid.uu = {0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80,
- 0x00, 0x10, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00}
- };
- static btgatt_gatt_id_t desc_1 = {
- .inst_id = 1,
- .uuid.uu = {0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80,
- 0x00, 0x10, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00}
- };
- static btgatt_gatt_id_t desc_2 = {
- .inst_id = 2,
- .uuid.uu = {0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80,
- 0x00, 0x10, 0x00, 0x00, 0x01, 0x29, 0x00, 0x00}
- };
- static btgatt_read_params_t read_params_1;
- static btgatt_write_params_t write_params_1;
- static btgatt_notify_params_t notify_params_1;
- static struct get_char_data get_char_data_1 = {
- .conn_id = CONN1_ID,
- .service = &service_1
- };
- static struct get_char_data get_char_data_2 = {
- .conn_id = CONN1_ID,
- .service = &service_2
- };
- static struct get_desc_data get_desc_data_1 = {
- .conn_id = CONN1_ID,
- .service = &service_1,
- .characteristic = &characteristic_1,
- };
- static struct get_desc_data get_desc_data_2 = {
- .conn_id = CONN1_ID,
- .service = &service_1,
- .characteristic = &characteristic_1,
- .desc = &desc_1,
- };
- static struct read_char_data read_char_data_1 = {
- .conn_id = CONN1_ID,
- .service = &service_1,
- .characteristic = &characteristic_1,
- };
- static struct read_char_data read_char_data_2 = {
- .conn_id = CONN1_ID,
- .service = &service_2,
- .characteristic = &characteristic_1,
- };
- static struct read_desc_data read_desc_data_1 = {
- .conn_id = CONN1_ID,
- .service = &service_1,
- .characteristic = &characteristic_1,
- .descriptor = &desc_1,
- };
- static struct read_desc_data read_desc_data_2 = {
- .conn_id = CONN1_ID,
- .service = &service_1,
- .characteristic = &characteristic_1,
- .descriptor = &desc_2,
- };
- static struct get_incl_data get_incl_data_1 = {
- .conn_id = CONN1_ID,
- .service = &service_1
- };
- static char value_2[] = {0x00, 0x01, 0x02, 0x03};
- static struct write_char_data write_char_data_1 = {
- .conn_id = CONN1_ID,
- .service = &service_1,
- .characteristic = &characteristic_1,
- .write_type = GATT_WRITE_TYPE_NO_RESPONSE,
- .len = sizeof(value_2),
- .p_value = value_2,
- .auth_req = 0
- };
- static struct write_char_data write_char_data_2 = {
- .conn_id = CONN1_ID,
- .service = &service_1,
- .characteristic = &characteristic_1,
- .write_type = GATT_WRITE_TYPE_DEFAULT,
- .len = sizeof(value_2),
- .p_value = value_2,
- .auth_req = 0
- };
- static struct write_desc_data write_desc_data_1 = {
- .conn_id = CONN1_ID,
- .service = &service_1,
- .characteristic = &characteristic_1,
- .descriptor = &desc_1,
- .write_type = 2,
- .len = sizeof(value_2),
- .auth_req = 0,
- .p_value = value_2,
- };
- static struct write_desc_data write_desc_data_2 = {
- .conn_id = CONN1_ID,
- .service = &service_1,
- .characteristic = &characteristic_1,
- .descriptor = &desc_2,
- .write_type = 2,
- .len = sizeof(value_2),
- .auth_req = 0,
- .p_value = value_2,
- };
- static struct notif_data notif_data_1 = {
- .conn_id = CONN1_ID,
- .service = &service_1,
- .charac = &characteristic_1,
- .bdaddr = &emu_remote_bdaddr_val,
- };
- static struct add_service_data add_service_data_1 = {
- .app_id = APP1_ID,
- .service = &service_add_1,
- .num_handles = 1
- };
- static struct add_service_data add_service_data_2 = {
- .app_id = APP1_ID,
- .service = &service_add_2,
- .num_handles = 1
- };
- static struct add_service_data add_service_data_3 = {
- .app_id = APP1_ID,
- .service = &service_add_3,
- .num_handles = 1
- };
- static struct add_service_data add_service_data_4 = {
- .app_id = APP1_ID,
- .service = &service_add_1,
- .num_handles = 2
- };
- static struct add_service_data add_service_data_5 = {
- .app_id = APP1_ID,
- .service = &service_add_1,
- .num_handles = 3
- };
- static struct add_service_data add_service_data_6 = {
- .app_id = APP1_ID,
- .service = &service_add_1,
- .num_handles = 4
- };
- static struct add_service_data add_bad_service_data_1 = {
- .app_id = APP1_ID,
- .service = &service_add_1,
- .num_handles = 0
- };
- static struct add_service_data add_sec_service_data_1 = {
- .app_id = APP1_ID,
- .service = &included_1,
- .num_handles = 1
- };
- static uint16_t srvc_bad_handle = 0xffff;
- static struct add_included_service_data add_inc_service_data_1 = {
- .app_id = APP1_ID,
- .inc_srvc_handle = &inc_srvc1_handle,
- .srvc_handle = &srvc1_handle
- };
- static struct add_included_service_data add_bad_inc_service_data_1 = {
- .app_id = APP1_ID,
- .inc_srvc_handle = &srvc_bad_handle,
- .srvc_handle = &srvc1_handle
- };
- static struct add_char_data add_char_data_1 = {
- .app_id = APP1_ID,
- .srvc_handle = &srvc1_handle,
- .uuid = &app1_uuid,
- .properties = 0,
- .permissions = 0
- };
- static struct add_char_data add_char_data_2 = {
- .app_id = APP1_ID,
- .srvc_handle = &srvc1_handle,
- .uuid = &app1_uuid,
- .properties = CHAR_PROP_WRITE,
- .permissions = CHAR_PERM_WRITE
- };
- static struct add_char_data add_bad_char_data_1 = {
- .app_id = APP1_ID,
- .srvc_handle = &srvc_bad_handle,
- .uuid = &app1_uuid,
- .properties = 0,
- .permissions = 0
- };
- static struct add_desc_data add_bad_desc_data_1 = {
- .app_id = APP1_ID,
- .srvc_handle = &srvc_bad_handle,
- .uuid = &app2_uuid,
- .permissions = 0
- };
- static struct add_desc_data add_bad_desc_data_2 = {
- .app_id = APP2_ID,
- .srvc_handle = &srvc1_handle,
- .uuid = &app2_uuid,
- .permissions = 0
- };
- static struct add_desc_data add_desc_data_1 = {
- .app_id = APP1_ID,
- .srvc_handle = &srvc1_handle,
- .uuid = &app2_uuid,
- .permissions = 0
- };
- static struct start_srvc_data start_srvc_data_1 = {
- .app_id = APP1_ID,
- .srvc_handle = &srvc1_handle,
- .transport = GATT_SERVER_TRANSPORT_LE_BREDR
- };
- static struct start_srvc_data start_srvc_data_2 = {
- .app_id = APP1_ID,
- .srvc_handle = &srvc1_handle,
- .transport = GATT_SERVER_TRANSPORT_LE
- };
- static struct start_srvc_data start_bad_srvc_data_1 = {
- .app_id = APP1_ID,
- .srvc_handle = &srvc_bad_handle,
- .transport = GATT_SERVER_TRANSPORT_LE
- };
- static struct start_srvc_data start_bad_srvc_data_2 = {
- .app_id = APP1_ID,
- .srvc_handle = &srvc1_handle,
- .transport = 0
- };
- static struct stop_srvc_data stop_srvc_data_1 = {
- .app_id = APP1_ID,
- .srvc_handle = &srvc1_handle
- };
- static struct stop_srvc_data stop_bad_srvc_data_1 = {
- .app_id = APP1_ID,
- .srvc_handle = &srvc_bad_handle
- };
- static struct delete_srvc_data delete_srvc_data_1 = {
- .app_id = APP1_ID,
- .srvc_handle = &srvc1_handle
- };
- static struct delete_srvc_data delete_bad_srvc_data_1 = {
- .app_id = APP1_ID,
- .srvc_handle = &srvc_bad_handle
- };
- static uint16_t srvc_indication_handle_1 = 0x01;
- static struct send_indication_data send_indication_data_1 = {
- .app_id = APP1_ID,
- .attr_handle = &srvc_indication_handle_1,
- .conn_id = CONN1_ID,
- .len = sizeof(value_2),
- .p_value = value_2,
- .confirm = 1
- };
- static struct send_indication_data send_indication_data_2 = {
- .app_id = APP1_ID,
- .attr_handle = &srvc_indication_handle_1,
- .conn_id = CONN1_ID,
- .len = sizeof(value_2),
- .p_value = value_2,
- .confirm = 0
- };
- static struct send_indication_data send_bad_indication_data_1 = {
- .app_id = APP1_ID,
- .attr_handle = &srvc_indication_handle_1,
- .conn_id = CONN2_ID,
- .len = sizeof(value_2),
- .p_value = value_2,
- .confirm = 0
- };
- struct set_read_params {
- btgatt_read_params_t *params;
- btgatt_srvc_id_t *srvc_id;
- btgatt_gatt_id_t *char_id;
- btgatt_gatt_id_t *descr_id;
- uint8_t *value;
- uint16_t len;
- uint16_t value_type;
- uint8_t status;
- };
- struct set_write_params {
- btgatt_write_params_t *params;
- btgatt_srvc_id_t *srvc_id;
- btgatt_gatt_id_t *char_id;
- btgatt_gatt_id_t *descr_id;
- uint8_t status;
- };
- struct set_notify_params {
- btgatt_notify_params_t *params;
- uint8_t *value;
- uint16_t len;
- uint8_t is_notify;
- btgatt_srvc_id_t *srvc_id;
- btgatt_gatt_id_t *char_id;
- bt_bdaddr_t *bdaddr;
- };
- static struct set_read_params set_read_param_1 = {
- .params = &read_params_1,
- .srvc_id = &service_1,
- .char_id = &characteristic_1,
- .value = value_1,
- .len = sizeof(value_1),
- .status = BT_STATUS_SUCCESS
- };
- static struct set_read_params set_read_param_2 = {
- .params = &read_params_1,
- .srvc_id = &service_1,
- .char_id = &characteristic_1,
- .status = GATT_STATUS_INS_AUTH
- };
- static struct set_read_params set_read_param_3 = {
- .params = &read_params_1,
- .srvc_id = &service_2,
- .char_id = &characteristic_1,
- .status = BT_STATUS_FAIL
- };
- static struct set_read_params set_read_param_4 = {
- .params = &read_params_1,
- .srvc_id = &service_1,
- .char_id = &characteristic_1,
- .descr_id = &desc_1,
- .value = value_1,
- .len = sizeof(value_1),
- .status = BT_STATUS_SUCCESS
- };
- static struct set_read_params set_read_param_5 = {
- .params = &read_params_1,
- .srvc_id = &service_1,
- .char_id = &characteristic_1,
- .descr_id = &desc_1,
- .status = GATT_STATUS_INS_AUTH
- };
- static struct set_read_params set_read_param_6 = {
- .params = &read_params_1,
- .srvc_id = &service_1,
- .char_id = &characteristic_1,
- .descr_id = &desc_2,
- .status = BT_STATUS_FAIL
- };
- static struct set_write_params set_write_param_1 = {
- .params = &write_params_1,
- .srvc_id = &service_1,
- .char_id = &characteristic_1,
- .status = BT_STATUS_SUCCESS
- };
- static struct set_write_params set_write_param_2 = {
- .params = &write_params_1,
- .srvc_id = &service_1,
- .char_id = &characteristic_1,
- .status = GATT_STATUS_INS_AUTH
- };
- static struct set_write_params set_write_param_3 = {
- .params = &write_params_1,
- .srvc_id = &service_1,
- .char_id = &characteristic_1,
- .status = BT_STATUS_FAIL
- };
- static struct set_write_params set_write_param_4 = {
- .params = &write_params_1,
- .srvc_id = &service_1,
- .char_id = &characteristic_1,
- .descr_id = &desc_1,
- .status = BT_STATUS_SUCCESS
- };
- static struct set_write_params set_write_param_5 = {
- .params = &write_params_1,
- .srvc_id = &service_1,
- .char_id = &characteristic_1,
- .descr_id = &desc_2,
- .status = BT_STATUS_FAIL
- };
- static struct set_write_params set_write_param_6 = {
- .params = &write_params_1,
- .srvc_id = &service_1,
- .char_id = &characteristic_1,
- .descr_id = &desc_1,
- .status = GATT_STATUS_INS_AUTH
- };
- static struct set_notify_params set_notify_param_1 = {
- .params = ¬ify_params_1,
- .value = value_1,
- .len = sizeof(value_1),
- .is_notify = 0,
- .srvc_id = &service_1,
- .char_id = &characteristic_1,
- .bdaddr = &emu_remote_bdaddr_val
- };
- static struct set_notify_params set_notify_param_2 = {
- .params = ¬ify_params_1,
- .value = value_1,
- .len = sizeof(value_1),
- .is_notify = 1,
- .srvc_id = &service_1,
- .char_id = &characteristic_1,
- .bdaddr = &emu_remote_bdaddr_val
- };
- static btgatt_response_t response_1 = {
- .handle = 0x1c,
- .attr_value.auth_req = 0,
- .attr_value.handle = 0x1d,
- .attr_value.len = 0,
- .attr_value.offset = 0,
- };
- static btgatt_response_t response_2 = {
- .handle = 0x1c,
- .attr_value.auth_req = 0,
- .attr_value.handle = 0x1d,
- .attr_value.len = sizeof(att_write_req_value_1),
- .attr_value.offset = 0,
- };
- static struct send_resp_data send_resp_data_1 = {
- .conn_id = CONN1_ID,
- .trans_id = TRANS1_ID,
- .status = BT_STATUS_SUCCESS,
- .response = &response_1,
- };
- static struct send_resp_data send_resp_data_2 = {
- .conn_id = CONN1_ID,
- .trans_id = TRANS1_ID,
- .status = BT_STATUS_SUCCESS,
- .response = &response_2,
- };
- static struct send_resp_data send_resp_data_2_error = {
- .conn_id = CONN1_ID,
- .trans_id = TRANS1_ID,
- .status = GATT_ERR_INVAL_ATTR_VALUE_LEN,
- .response = &response_2,
- };
- #define SEARCH_SERVICE_SINGLE_SUCCESS_PDUS \
- raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), \
- raw_pdu(0x11, 0x06, 0x01, 0x00, 0x10, 0x00, 0x00, 0x18), \
- raw_pdu(0x10, 0x11, 0x00, 0xff, 0xff, 0x00, 0x28), \
- raw_pdu(0x01, 0x10, 0x11, 0x00, 0x0a)
- #define READ_BY_TYPE_SINGLE_CHARACTERISTIC_PDUS \
- raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x03, 0x28), \
- raw_pdu(0x09, 0x07, 0x02, 0x00, 0x04, 0x00, 0x00, 0x19, 0x00), \
- raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x03, 0x28), \
- raw_pdu(0x01, 0x08, 0x03, 0x00, 0x0a)
- static struct iovec search_service[] = {
- SEARCH_SERVICE_SINGLE_SUCCESS_PDUS,
- end_pdu
- };
- static struct iovec search_service_2[] = {
- raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28),
- raw_pdu(0x11, 0x06, 0x01, 0x00, 0x10, 0x00, 0x00, 0x18),
- raw_pdu(0x10, 0x11, 0x00, 0xff, 0xff, 0x00, 0x28),
- raw_pdu(0x11, 0x06, 0x11, 0x00, 0x20, 0x00, 0x01, 0x18),
- raw_pdu(0x10, 0x21, 0x00, 0xff, 0xff, 0x00, 0x28),
- raw_pdu(0x01, 0x10, 0x21, 0x00, 0x0a),
- end_pdu
- };
- static struct iovec search_service_3[] = {
- raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28),
- raw_pdu(0x01, 0x08, 0x01, 0x00, 0x0a),
- end_pdu
- };
- static struct iovec search_service_4[] = {
- raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28),
- raw_pdu(0x11, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x18),
- end_pdu
- };
- static struct iovec get_characteristic_1[] = {
- SEARCH_SERVICE_SINGLE_SUCCESS_PDUS,
- READ_BY_TYPE_SINGLE_CHARACTERISTIC_PDUS,
- end_pdu
- };
- static struct iovec get_characteristic_2[] = {
- SEARCH_SERVICE_SINGLE_SUCCESS_PDUS,
- raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x03, 0x28),
- raw_pdu(0x09, 0x07, 0x00, 0x00, 0x04, 0x00, 0x00, 0x19, 0x00),
- end_pdu
- };
- static struct iovec get_descriptor_0[] = {
- SEARCH_SERVICE_SINGLE_SUCCESS_PDUS,
- READ_BY_TYPE_SINGLE_CHARACTERISTIC_PDUS,
- raw_pdu(0x04, 0x01, 0x00, 0x10, 0x00),
- raw_pdu(0x05, 0x01, 0x00, 0x00, 0x00, 0x29),
- end_pdu
- };
- static struct iovec get_descriptor_1[] = {
- SEARCH_SERVICE_SINGLE_SUCCESS_PDUS,
- READ_BY_TYPE_SINGLE_CHARACTERISTIC_PDUS,
- raw_pdu(0x04, 0x01, 0x00, 0x10, 0x00),
- raw_pdu(0x05, 0x01, 0x04, 0x00, 0x00, 0x29),
- raw_pdu(0x04, 0x05, 0x00, 0x10, 0x00),
- raw_pdu(0x01, 0x04, 0x05, 0x00, 0x0a),
- end_pdu
- };
- static struct iovec get_descriptor_2[] = {
- SEARCH_SERVICE_SINGLE_SUCCESS_PDUS,
- READ_BY_TYPE_SINGLE_CHARACTERISTIC_PDUS,
- raw_pdu(0x04, 0x01, 0x00, 0x10, 0x00),
- raw_pdu(0x05, 0x01, 0x04, 0x00, 0x00, 0x29, 0x05, 0x00, 0x01, 0x29),
- raw_pdu(0x04, 0x06, 0x00, 0x10, 0x00),
- raw_pdu(0x01, 0x04, 0x06, 0x00, 0x0a),
- end_pdu
- };
- static struct iovec get_descriptor_3[] = {
- SEARCH_SERVICE_SINGLE_SUCCESS_PDUS,
- READ_BY_TYPE_SINGLE_CHARACTERISTIC_PDUS,
- raw_pdu(0x04, 0x01, 0x00, 0x10, 0x00),
- raw_pdu(0x01, 0x04, 0x01, 0x00, 0x0a),
- end_pdu
- };
- static struct iovec get_included_0[] = {
- SEARCH_SERVICE_SINGLE_SUCCESS_PDUS,
- raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x02, 0x28),
- raw_pdu(0x09, 0x08, 0x00, 0x00, 0x15, 0x00, 0x19, 0x00, 0xff, 0xfe),
- end_pdu
- };
- static struct iovec get_included_1[] = {
- SEARCH_SERVICE_SINGLE_SUCCESS_PDUS,
- raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x02, 0x28),
- raw_pdu(0x09, 0x08, 0x02, 0x00, 0x15, 0x00, 0x19, 0x00, 0xff, 0xfe),
- raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x02, 0x28),
- raw_pdu(0x01, 0x08, 0x03, 0x00, 0x0a),
- end_pdu
- };
- static struct iovec get_included_2[] = {
- SEARCH_SERVICE_SINGLE_SUCCESS_PDUS,
- raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x02, 0x28),
- raw_pdu(0x09, 0x06, 0x02, 0x00, 0x15, 0x00, 0x19, 0x00),
- raw_pdu(0x0a, 0x15, 0x00),
- raw_pdu(0x0b, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
- 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10),
- raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x02, 0x28),
- raw_pdu(0x01, 0x08, 0x03, 0x00, 0x0a),
- end_pdu
- };
- static struct iovec get_included_3[] = {
- SEARCH_SERVICE_SINGLE_SUCCESS_PDUS,
- raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x02, 0x28),
- raw_pdu(0x01, 0x08, 0x01, 0x00, 0x0a),
- end_pdu
- };
- static struct iovec read_characteristic_1[] = {
- SEARCH_SERVICE_SINGLE_SUCCESS_PDUS,
- raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x03, 0x28),
- raw_pdu(0x09, 0x07, 0x02, 0x00, 0x04, 0x03, 0x00, 0x19, 0x00),
- raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x03, 0x28),
- raw_pdu(0x01, 0x08, 0x03, 0x00, 0x0a),
- raw_pdu(0x0a, 0x03, 0x00),
- raw_pdu(0x0b, 0x01),
- end_pdu
- };
- static struct iovec read_characteristic_2[] = {
- SEARCH_SERVICE_SINGLE_SUCCESS_PDUS,
- raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x03, 0x28),
- raw_pdu(0x09, 0x07, 0x02, 0x00, 0x04, 0x03, 0x00, 0x19, 0x00),
- raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x03, 0x28),
- raw_pdu(0x01, 0x08, 0x03, 0x00, 0x0a),
- raw_pdu(0x0a, 0x03, 0x00),
- raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x08),
- end_pdu
- };
- static struct iovec read_descriptor_1[] = {
- SEARCH_SERVICE_SINGLE_SUCCESS_PDUS,
- READ_BY_TYPE_SINGLE_CHARACTERISTIC_PDUS,
- raw_pdu(0x04, 0x01, 0x00, 0x10, 0x00),
- raw_pdu(0x05, 0x01, 0x04, 0x00, 0x00, 0x29),
- raw_pdu(0x04, 0x05, 0x00, 0x10, 0x00),
- raw_pdu(0x01, 0x04, 0x05, 0x00, 0x0a),
- raw_pdu(0x0a, 0x04, 0x00),
- raw_pdu(0x0b, 0x01),
- end_pdu
- };
- static struct iovec read_descriptor_2[] = {
- SEARCH_SERVICE_SINGLE_SUCCESS_PDUS,
- READ_BY_TYPE_SINGLE_CHARACTERISTIC_PDUS,
- raw_pdu(0x04, 0x01, 0x00, 0x10, 0x00),
- raw_pdu(0x05, 0x01, 0x04, 0x00, 0x00, 0x29),
- raw_pdu(0x04, 0x05, 0x00, 0x10, 0x00),
- raw_pdu(0x01, 0x04, 0x05, 0x00, 0x0a),
- raw_pdu(0x0a, 0x04, 0x00),
- raw_pdu(0x01, 0x0a, 0x04, 0x00, 0x08),
- end_pdu
- };
- static struct iovec write_characteristic_1[] = {
- SEARCH_SERVICE_SINGLE_SUCCESS_PDUS,
- raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x03, 0x28),
- raw_pdu(0x09, 0x07, 0x02, 0x00, 0x04, 0x03, 0x00, 0x19, 0x00),
- raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x03, 0x28),
- raw_pdu(0x01, 0x08, 0x03, 0x00, 0x0a),
- raw_pdu(0x52, 0x03, 0x00, 0x00, 0x01, 0x02, 0x03),
- end_pdu
- };
- static struct iovec write_characteristic_2[] = {
- SEARCH_SERVICE_SINGLE_SUCCESS_PDUS,
- raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x03, 0x28),
- raw_pdu(0x09, 0x07, 0x02, 0x00, 0x04, 0x03, 0x00, 0x19, 0x00),
- raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x03, 0x28),
- raw_pdu(0x01, 0x08, 0x03, 0x00, 0x0a),
- raw_pdu(0x12, 0x03, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x13),
- end_pdu
- };
- static struct iovec write_characteristic_3[] = {
- SEARCH_SERVICE_SINGLE_SUCCESS_PDUS,
- raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x03, 0x28),
- raw_pdu(0x09, 0x07, 0x02, 0x00, 0x04, 0x03, 0x00, 0x19, 0x00),
- raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x03, 0x28),
- raw_pdu(0x01, 0x08, 0x03, 0x00, 0x0a),
- raw_pdu(0x12, 0x03, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x12, 0x03, 0x00, 0x08),
- end_pdu
- };
- static struct iovec write_descriptor_1[] = {
- SEARCH_SERVICE_SINGLE_SUCCESS_PDUS,
- READ_BY_TYPE_SINGLE_CHARACTERISTIC_PDUS,
- raw_pdu(0x04, 0x01, 0x00, 0x10, 0x00),
- raw_pdu(0x05, 0x01, 0x04, 0x00, 0x00, 0x29),
- raw_pdu(0x04, 0x05, 0x00, 0x10, 0x00),
- raw_pdu(0x01, 0x04, 0x05, 0x00, 0x0a),
- raw_pdu(0x12, 0x04, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x13),
- end_pdu
- };
- static struct iovec write_descriptor_2[] = {
- SEARCH_SERVICE_SINGLE_SUCCESS_PDUS,
- READ_BY_TYPE_SINGLE_CHARACTERISTIC_PDUS,
- raw_pdu(0x04, 0x01, 0x00, 0x10, 0x00),
- raw_pdu(0x05, 0x01, 0x04, 0x00, 0x00, 0x29),
- raw_pdu(0x04, 0x05, 0x00, 0x10, 0x00),
- raw_pdu(0x01, 0x04, 0x05, 0x00, 0x0a),
- raw_pdu(0x12, 0x04, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x12, 0x04, 0x00, 0x08),
- end_pdu
- };
- static struct iovec notification_1[] = {
- SEARCH_SERVICE_SINGLE_SUCCESS_PDUS,
- READ_BY_TYPE_SINGLE_CHARACTERISTIC_PDUS,
- end_pdu
- };
- static struct iovec notification_2[] = {
- SEARCH_SERVICE_SINGLE_SUCCESS_PDUS,
- READ_BY_TYPE_SINGLE_CHARACTERISTIC_PDUS,
- raw_pdu(0x1d, 0x03, 0x00, 0x01),
- raw_pdu(0x1e),
- end_pdu
- };
- static struct iovec notification_3[] = {
- SEARCH_SERVICE_SINGLE_SUCCESS_PDUS,
- READ_BY_TYPE_SINGLE_CHARACTERISTIC_PDUS,
- raw_pdu(0x1b, 0x03, 0x00, 0x01),
- end_pdu
- };
- static struct iovec send_indication_1[] = {
- raw_pdu(0x1d, 0x01, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x1e),
- end_pdu
- };
- static struct iovec send_notification_1[] = {
- raw_pdu(0x1b, 0x01, 0x00, 0x00, 0x01, 0x02, 0x03),
- end_pdu
- };
- static struct iovec search_range_1[] = {
- raw_pdu(0x01, 0xff, 0xff, 0xff),
- end_pdu
- };
- static struct iovec primary_type = raw_pdu(0x00, 0x28);
- /* att commands define raw pdus */
- static struct iovec att_read_req_op_v = raw_pdu(L2CAP_ATT_READ_REQ);
- static struct iovec att_write_req_op_v = raw_pdu(L2CAP_ATT_WRITE_REQ);
- static struct iovec att_find_by_type_req_op_v =
- raw_pdu(L2CAP_ATT_FIND_BY_TYPE_REQ);
- static struct iovec svc_change_ccc_handle_v = raw_pdu(0x1c, 0x00);
- static struct iovec svc_change_ccc_value_v = raw_pdu(0x00, 0x01);
- static void gatt_client_register_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- bt_uuid_t *app_uuid = current_data_step->set_data;
- struct step *step = g_new0(struct step, 1);
- if (!app_uuid) {
- tester_warn("No app uuid provided for register action.");
- return;
- }
- step->action_status = data->if_gatt->client->register_client(app_uuid);
- schedule_action_verification(step);
- }
- static void gatt_client_unregister_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- int32_t cl_id = PTR_TO_INT(current_data_step->set_data);
- struct step *step = g_new0(struct step, 1);
- step->action_status = data->if_gatt->client->unregister_client(cl_id);
- schedule_action_verification(step);
- }
- static void gatt_client_start_scan_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *step = g_new0(struct step, 1);
- step->action_status = data->if_gatt->client->scan(TRUE);
- schedule_action_verification(step);
- }
- static void gatt_client_stop_scan_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *step = g_new0(struct step, 1);
- step->action_status = data->if_gatt->client->scan(FALSE);
- schedule_action_verification(step);
- }
- static void gatt_client_connect_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct gatt_connect_data *conn_data = current_data_step->set_data;
- struct step *step = g_new0(struct step, 1);
- step->action_status = data->if_gatt->client->connect(
- conn_data->app_id,
- &emu_remote_bdaddr_val, 0,
- BT_TRANSPORT_UNKNOWN);
- schedule_action_verification(step);
- }
- static void gatt_client_disconnect_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct gatt_connect_data *conn_data = current_data_step->set_data;
- struct step *step = g_new0(struct step, 1);
- step->action_status = data->if_gatt->client->disconnect(
- conn_data->app_id,
- &emu_remote_bdaddr_val,
- conn_data->conn_id);
- schedule_action_verification(step);
- }
- static void gatt_client_do_listen_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct gatt_connect_data *conn_data = current_data_step->set_data;
- struct step *step = g_new0(struct step, 1);
- step->action_status = data->if_gatt->client->listen(
- conn_data->app_id,
- 1);
- schedule_action_verification(step);
- }
- static void gatt_client_stop_listen_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct gatt_connect_data *conn_data = current_data_step->set_data;
- struct step *step = g_new0(struct step, 1);
- step->action_status = data->if_gatt->client->listen(
- conn_data->app_id,
- 0);
- schedule_action_verification(step);
- }
- static void gatt_client_get_characteristic_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct get_char_data *get_char = current_data_step->set_data;
- const btgatt_client_interface_t *client = data->if_gatt->client;
- struct step *step = g_new0(struct step, 1);
- int status;
- status = client->get_characteristic(get_char->conn_id,
- get_char->service, NULL);
- step->action_status = status;
- schedule_action_verification(step);
- }
- static void gatt_client_get_descriptor_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct get_desc_data *get_desc = current_data_step->set_data;
- const btgatt_client_interface_t *client = data->if_gatt->client;
- struct step *step = g_new0(struct step, 1);
- int status;
- status = client->get_descriptor(get_desc->conn_id, get_desc->service,
- get_desc->characteristic,
- get_desc->desc);
- step->action_status = status;
- schedule_action_verification(step);
- }
- static void gatt_client_get_included_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct get_incl_data *get_incl = current_data_step->set_data;
- const btgatt_client_interface_t *client = data->if_gatt->client;
- struct step *step = g_new0(struct step, 1);
- int status;
- status = client->get_included_service(get_incl->conn_id,
- get_incl->service, get_incl->start_service);
- step->action_status = status;
- schedule_action_verification(step);
- }
- static void gatt_client_read_characteristic_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct read_char_data *read_char_data = current_data_step->set_data;
- const btgatt_client_interface_t *client = data->if_gatt->client;
- struct step *step = g_new0(struct step, 1);
- int status;
- status = client->read_characteristic(read_char_data->conn_id,
- read_char_data->service, read_char_data->characteristic,
- read_char_data->auth_req);
- step->action_status = status;
- schedule_action_verification(step);
- }
- static void gatt_client_read_descriptor_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct read_desc_data *read_desc_data = current_data_step->set_data;
- const btgatt_client_interface_t *client = data->if_gatt->client;
- struct step *step = g_new0(struct step, 1);
- int status;
- status = client->read_descriptor(read_desc_data->conn_id,
- read_desc_data->service, read_desc_data->characteristic,
- read_desc_data->descriptor,
- read_desc_data->auth_req);
- step->action_status = status;
- schedule_action_verification(step);
- }
- static void gatt_client_write_characteristic_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct write_char_data *write_char_data = current_data_step->set_data;
- const btgatt_client_interface_t *client = data->if_gatt->client;
- struct step *step = g_new0(struct step, 1);
- int status;
- status = client->write_characteristic(write_char_data->conn_id,
- write_char_data->service,
- write_char_data->characteristic,
- write_char_data->write_type,
- write_char_data->len,
- write_char_data->auth_req,
- write_char_data->p_value);
- step->action_status = status;
- schedule_action_verification(step);
- }
- static void gatt_client_register_for_notification_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct notif_data *notif_data = current_data_step->set_data;
- const btgatt_client_interface_t *client = data->if_gatt->client;
- struct step *step = g_new0(struct step, 1);
- int status;
- status = client->register_for_notification(notif_data->conn_id,
- notif_data->bdaddr,
- notif_data->service,
- notif_data->charac);
- step->action_status = status;
- schedule_action_verification(step);
- }
- static void gatt_client_deregister_for_notification_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct notif_data *notif_data = current_data_step->set_data;
- const btgatt_client_interface_t *client = data->if_gatt->client;
- struct step *step = g_new0(struct step, 1);
- int status;
- status = client->deregister_for_notification(notif_data->conn_id,
- notif_data->bdaddr,
- notif_data->service,
- notif_data->charac);
- step->action_status = status;
- schedule_action_verification(step);
- }
- static void gatt_server_register_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- bt_uuid_t *app_uuid = current_data_step->set_data;
- struct step *step = g_new0(struct step, 1);
- if (!app_uuid) {
- tester_warn("No app uuid provided for register action.");
- return;
- }
- step->action_status = data->if_gatt->server->register_server(app_uuid);
- schedule_action_verification(step);
- }
- static void gatt_server_unregister_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- int32_t sr_id = PTR_TO_INT(current_data_step->set_data);
- struct step *step = g_new0(struct step, 1);
- step->action_status = data->if_gatt->server->unregister_server(sr_id);
- schedule_action_verification(step);
- }
- static void gatt_server_connect_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct gatt_connect_data *conn_data = current_data_step->set_data;
- struct step *step = g_new0(struct step, 1);
- step->action_status = data->if_gatt->server->connect(
- conn_data->app_id,
- &emu_remote_bdaddr_val, 0,
- BT_TRANSPORT_UNKNOWN);
- schedule_action_verification(step);
- }
- static void gatt_server_disconnect_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct gatt_connect_data *conn_data = current_data_step->set_data;
- struct step *step = g_new0(struct step, 1);
- step->action_status = data->if_gatt->server->disconnect(
- conn_data->app_id,
- &emu_remote_bdaddr_val,
- conn_data->conn_id);
- schedule_action_verification(step);
- }
- static void gatt_server_add_service_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct add_service_data *add_srvc_data = current_data_step->set_data;
- struct step *step = g_new0(struct step, 1);
- step->action_status = data->if_gatt->server->add_service(
- add_srvc_data->app_id,
- add_srvc_data->service,
- add_srvc_data->num_handles);
- schedule_action_verification(step);
- }
- static void gatt_server_add_inc_service_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct add_included_service_data *add_inc_srvc_data =
- current_data_step->set_data;
- struct step *step = g_new0(struct step, 1);
- step->action_status = data->if_gatt->server->add_included_service(
- add_inc_srvc_data->app_id,
- *add_inc_srvc_data->srvc_handle,
- *add_inc_srvc_data->inc_srvc_handle);
- schedule_action_verification(step);
- }
- static void gatt_server_add_char_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct add_char_data *add_char_data = current_data_step->set_data;
- struct step *step = g_new0(struct step, 1);
- step->action_status = data->if_gatt->server->add_characteristic(
- add_char_data->app_id,
- *add_char_data->srvc_handle,
- add_char_data->uuid,
- add_char_data->properties,
- add_char_data->permissions);
- schedule_action_verification(step);
- }
- static void gatt_server_add_desc_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct add_desc_data *add_desc_data = current_data_step->set_data;
- struct step *step = g_new0(struct step, 1);
- step->action_status = data->if_gatt->server->add_descriptor(
- add_desc_data->app_id,
- *add_desc_data->srvc_handle,
- add_desc_data->uuid,
- add_desc_data->permissions);
- schedule_action_verification(step);
- }
- static void gatt_client_write_descriptor_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct write_desc_data *write_desc_data = current_data_step->set_data;
- const btgatt_client_interface_t *client = data->if_gatt->client;
- struct step *step = g_new0(struct step, 1);
- int status;
- status = client->write_descriptor(write_desc_data->conn_id,
- write_desc_data->service,
- write_desc_data->characteristic,
- write_desc_data->descriptor,
- write_desc_data->write_type,
- write_desc_data->len,
- write_desc_data->auth_req,
- write_desc_data->p_value);
- step->action_status = status;
- schedule_action_verification(step);
- }
- static void gatt_server_start_srvc_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct start_srvc_data *start_srvc_data = current_data_step->set_data;
- struct step *step = g_new0(struct step, 1);
- step->action_status = data->if_gatt->server->start_service(
- start_srvc_data->app_id,
- *start_srvc_data->srvc_handle,
- start_srvc_data->transport);
- schedule_action_verification(step);
- }
- static void gatt_server_stop_srvc_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct stop_srvc_data *stop_srvc_data = current_data_step->set_data;
- struct step *step = g_new0(struct step, 1);
- step->action_status = data->if_gatt->server->stop_service(
- stop_srvc_data->app_id,
- *stop_srvc_data->srvc_handle);
- schedule_action_verification(step);
- }
- static void gatt_server_delete_srvc_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct delete_srvc_data *delete_srvc_data = current_data_step->set_data;
- struct step *step = g_new0(struct step, 1);
- step->action_status = data->if_gatt->server->delete_service(
- delete_srvc_data->app_id,
- *delete_srvc_data->srvc_handle);
- schedule_action_verification(step);
- }
- static void gatt_server_send_indication_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct send_indication_data *send_indication_data =
- current_data_step->set_data;
- struct step *step = g_new0(struct step, 1);
- step->action_status = data->if_gatt->server->send_indication(
- send_indication_data->app_id,
- *send_indication_data->attr_handle,
- send_indication_data->conn_id,
- send_indication_data->len,
- send_indication_data->confirm,
- send_indication_data->p_value);
- schedule_action_verification(step);
- }
- static void gatt_server_send_response_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct send_resp_data *send_resp_data = current_data_step->set_data;
- struct step *step = g_new0(struct step, 1);
- step->action_status = data->if_gatt->server->send_response(
- send_resp_data->conn_id,
- send_resp_data->trans_id,
- send_resp_data->status,
- send_resp_data->response);
- schedule_action_verification(step);
- }
- static void gatt_cid_hook_cb(const void *data, uint16_t len, void *user_data)
- {
- struct test_data *t_data = tester_get_data();
- struct bthost *bthost = hciemu_client_get_host(t_data->hciemu);
- struct emu_l2cap_cid_data *cid_data = user_data;
- const uint8_t *pdu = data;
- struct iovec *gatt_pdu = queue_peek_head(t_data->pdus);
- struct step *step;
- tester_debug("Received att pdu with opcode 0x%02x", pdu[0]);
- switch (pdu[0]) {
- case L2CAP_ATT_ERROR:
- step = g_new0(struct step, 1);
- step->callback = CB_EMU_ATT_ERROR;
- step->callback_result.error = pdu[4];
- schedule_callback_verification(step);
- break;
- case L2CAP_ATT_EXCHANGE_MTU_REQ:
- tester_print("Exchange MTU request received.");
- if (!memcmp(exchange_mtu_req_pdu.iov_base, pdu, len))
- bthost_send_cid_v(bthost, cid_data->handle,
- cid_data->cid,
- &exchange_mtu_resp_pdu, 1);
- break;
- case L2CAP_ATT_EXCHANGE_MTU_RSP:
- tester_print("Exchange MTU response received.");
- break;
- case L2CAP_ATT_HANDLE_VALUE_IND:
- step = g_new0(struct step, 1);
- step->callback = CB_EMU_VALUE_INDICATION;
- schedule_callback_verification(step);
- goto respond;
- case L2CAP_ATT_HANDLE_VALUE_NOTIFY:
- step = g_new0(struct step, 1);
- step->callback = CB_EMU_VALUE_NOTIFICATION;
- schedule_callback_verification(step);
- break;
- case L2CAP_ATT_READ_RSP:
- /* TODO - More complicated cases should also verify pdu data */
- step = g_new0(struct step, 1);
- step->callback = CB_EMU_READ_RESPONSE;
- schedule_callback_verification(step);
- break;
- case L2CAP_ATT_WRITE_RSP:
- /* TODO - More complicated cases should also verify pdu data */
- step = g_new0(struct step, 1);
- step->callback = CB_EMU_WRITE_RESPONSE;
- schedule_callback_verification(step);
- break;
- default:
- if (!gatt_pdu || !gatt_pdu->iov_base) {
- tester_print("Unknown ATT packet.");
- break;
- }
- if (gatt_pdu->iov_len != len) {
- tester_print("Size of incoming frame is not valid");
- tester_print("Expected size = %zd incoming size = %d",
- gatt_pdu->iov_len, len);
- break;
- }
- respond:
- if (memcmp(gatt_pdu->iov_base, data, len)) {
- tester_print("Incoming data mismatch");
- break;
- }
- queue_pop_head(t_data->pdus);
- gatt_pdu = queue_pop_head(t_data->pdus);
- if (!gatt_pdu || !gatt_pdu->iov_base)
- break;
- bthost_send_cid_v(bthost, cid_data->handle, cid_data->cid,
- gatt_pdu, 1);
- break;
- }
- }
- static void gatt_remote_send_frame_action(void)
- {
- struct test_data *t_data = tester_get_data();
- struct bthost *bthost = hciemu_client_get_host(t_data->hciemu);
- struct iovec *gatt_pdu = queue_pop_head(t_data->pdus);
- struct step *step = g_new0(struct step, 1);
- if (!gatt_pdu) {
- tester_print("No frame to send");
- step->action_status = BT_STATUS_FAIL;
- } else {
- bthost_send_cid_v(bthost, cid_data.handle, cid_data.cid,
- gatt_pdu, 1);
- step->action_status = BT_STATUS_SUCCESS;
- }
- schedule_action_verification(step);
- }
- static void gatt_remote_send_raw_pdu_action(void)
- {
- struct test_data *data = tester_get_data();
- struct bthost *bthost = hciemu_client_get_host(data->hciemu);
- struct step *current_data_step = queue_peek_head(data->steps);
- struct iovec *pdu = current_data_step->set_data;
- struct iovec *pdu2 = current_data_step->set_data_2;
- struct iovec *pdu3 = current_data_step->set_data_3;
- struct step *step = g_new0(struct step, 1);
- if (cid_data.handle && cid_data.cid) {
- struct iovec rsp[3];
- size_t len = 0;
- if (!pdu) {
- step->action_status = BT_STATUS_FAIL;
- goto done;
- }
- rsp[0].iov_base = pdu->iov_base;
- rsp[0].iov_len = pdu->iov_len;
- len++;
- if (pdu2) {
- rsp[1].iov_base = pdu2->iov_base;
- rsp[1].iov_len = pdu2->iov_len;
- len++;
- }
- if (pdu3) {
- rsp[2].iov_base = pdu3->iov_base;
- rsp[2].iov_len = pdu3->iov_len;
- len++;
- }
- bthost_send_cid_v(bthost, cid_data.handle, cid_data.cid, rsp,
- len);
- step->action_status = BT_STATUS_SUCCESS;
- } else {
- tester_debug("No connection set up");
- step->action_status = BT_STATUS_FAIL;
- }
- done:
- schedule_action_verification(step);
- }
- static void gatt_conn_cb(uint16_t handle, void *user_data)
- {
- struct test_data *data = tester_get_data();
- struct bthost *bthost = hciemu_client_get_host(data->hciemu);
- tester_print("New connection with handle 0x%04x", handle);
- if (data->hciemu_type == HCIEMU_TYPE_BREDR) {
- tester_warn("Not handled device type.");
- return;
- }
- cid_data.cid = 0x0004;
- cid_data.handle = handle;
- bthost_add_cid_hook(bthost, handle, cid_data.cid, gatt_cid_hook_cb,
- &cid_data);
- }
- static void gatt_client_search_services(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct step *step = g_new0(struct step, 1);
- struct gatt_search_service_data *search_data;
- int status;
- search_data = current_data_step->set_data;
- status = data->if_gatt->client->search_service(search_data->conn_id,
- search_data->filter_uuid);
- step->action_status = status;
- schedule_action_verification(step);
- }
- static void init_pdus(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct step *step = g_new0(struct step, 1);
- struct iovec *pdu = current_data_step->set_data;
- while (pdu->iov_base) {
- queue_push_tail(data->pdus, pdu);
- pdu++;
- }
- step->action_status = BT_STATUS_SUCCESS;
- schedule_action_verification(step);
- }
- static void init_read_params_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct step *step = g_new0(struct step, 1);
- struct set_read_params *set_param_data = current_data_step->set_data;
- btgatt_read_params_t *param = set_param_data->params;
- memset(param, 0, sizeof(*param));
- if (set_param_data->srvc_id)
- memcpy(¶m->srvc_id, set_param_data->srvc_id,
- sizeof(btgatt_srvc_id_t));
- if (set_param_data->char_id)
- memcpy(¶m->char_id, set_param_data->char_id,
- sizeof(btgatt_gatt_id_t));
- if (set_param_data->descr_id)
- memcpy(¶m->descr_id, set_param_data->descr_id,
- sizeof(btgatt_gatt_id_t));
- param->value_type = set_param_data->value_type;
- param->status = set_param_data->status;
- param->value.len = set_param_data->len;
- if (param->value.len != 0)
- memcpy(¶m->value.value, set_param_data->value,
- param->value.len);
- step->action_status = BT_STATUS_SUCCESS;
- schedule_action_verification(step);
- }
- static void init_write_params_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct step *step = g_new0(struct step, 1);
- struct set_write_params *set_param_data = current_data_step->set_data;
- btgatt_write_params_t *param = set_param_data->params;
- memset(param, 0, sizeof(*param));
- if (set_param_data->srvc_id)
- memcpy(¶m->srvc_id, set_param_data->srvc_id,
- sizeof(btgatt_srvc_id_t));
- if (set_param_data->char_id)
- memcpy(¶m->char_id, set_param_data->char_id,
- sizeof(btgatt_gatt_id_t));
- if (set_param_data->descr_id)
- memcpy(¶m->descr_id, set_param_data->descr_id,
- sizeof(btgatt_gatt_id_t));
- param->status = set_param_data->status;
- step->action_status = BT_STATUS_SUCCESS;
- schedule_action_verification(step);
- }
- static void init_notify_params_action(void)
- {
- struct test_data *data = tester_get_data();
- struct step *current_data_step = queue_peek_head(data->steps);
- struct step *step = g_new0(struct step, 1);
- struct set_notify_params *set_param_data = current_data_step->set_data;
- btgatt_notify_params_t *param = set_param_data->params;
- memset(param, 0, sizeof(*param));
- if (set_param_data->srvc_id)
- memcpy(¶m->srvc_id, set_param_data->srvc_id,
- sizeof(btgatt_srvc_id_t));
- if (set_param_data->char_id)
- memcpy(¶m->char_id, set_param_data->char_id,
- sizeof(btgatt_gatt_id_t));
- param->len = set_param_data->len;
- param->is_notify = set_param_data->is_notify;
- memcpy(¶m->bda, set_param_data->bdaddr, sizeof(bt_bdaddr_t));
- if (param->len != 0)
- memcpy(¶m->value, set_param_data->value, param->len);
- step->action_status = BT_STATUS_SUCCESS;
- schedule_action_verification(step);
- }
- static void trigger_device_found(void *user_data)
- {
- emu_setup_powered_remote_action();
- }
- static void delayemu_setup_powered_remote_action(void)
- {
- /* Make sure discovery is enabled before enabling advertising.
- * Unfortunately GATT HAL doesn't have discovering callback like
- * Bluetooth HAL so we need to delay
- */
- tester_wait(1, trigger_device_found, NULL);
- }
- static struct test_case test_cases[] = {
- TEST_CASE_BREDRLE("Gatt Init",
- ACTION_SUCCESS(dummy_action, NULL),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Register",
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Unregister",
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_unregister_action,
- INT_TO_PTR(APP1_ID)),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Scan",
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CALLBACK_DEVICE_FOUND(prop_emu_remotes_default_le_set, 2),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - LE Connect",
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CALLBACK_DEVICE_FOUND(prop_emu_remotes_default_le_set, 2),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - LE Disconnect",
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CALLBACK_DEVICE_FOUND(prop_emu_remotes_default_le_set, 2),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_disconnect_action,
- &app1_conn_req),
- CALLBACK_GATTC_DISCONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - LE Multiple Client Conn./Disc.",
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_register_action, &app2_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_connect_action, &app2_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN2_ID, APP2_ID),
- ACTION_SUCCESS(gatt_client_disconnect_action,
- &app2_conn_req),
- CALLBACK_GATTC_DISCONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN2_ID, APP2_ID),
- ACTION_SUCCESS(gatt_client_disconnect_action,
- &app1_conn_req),
- CALLBACK_GATTC_DISCONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Listen and Disconnect",
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(bt_set_property_action,
- &prop_test_scan_mode_conn),
- CALLBACK_ADAPTER_PROPS(&prop_test_scan_mode_conn, 1),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_do_listen_action, &app1_conn_req),
- CALLBACK_STATUS(CB_GATTC_LISTEN, GATT_STATUS_SUCCESS),
- ACTION_SUCCESS(emu_remote_connect_hci_action, &bearer_type),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_stop_listen_action,
- &app1_conn_req),
- CALLBACK_STATUS(CB_GATTC_LISTEN, GATT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_disconnect_action,
- &app1_conn_req),
- CALLBACK_GATTC_DISCONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Double Listen",
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(bt_set_property_action,
- &prop_test_scan_mode_conn),
- CALLBACK_ADAPTER_PROPS(&prop_test_scan_mode_conn, 1),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_do_listen_action, &app1_conn_req),
- CALLBACK_STATUS(CB_GATTC_LISTEN, GATT_STATUS_SUCCESS),
- ACTION_SUCCESS(emu_remote_connect_hci_action, &bearer_type),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_stop_listen_action,
- &app1_conn_req),
- CALLBACK_STATUS(CB_GATTC_LISTEN, GATT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_disconnect_action,
- &app1_conn_req),
- CALLBACK_GATTC_DISCONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- /* Close ACL on emulated remotes side so it can reconnect */
- ACTION_SUCCESS(emu_remote_disconnect_hci_action,
- &cid_data.handle),
- CALLBACK_STATE(CB_BT_ACL_STATE_CHANGED,
- BT_ACL_STATE_DISCONNECTED),
- ACTION_SUCCESS(gatt_client_do_listen_action, &app1_conn_req),
- CALLBACK_STATUS(CB_GATTC_LISTEN, GATT_STATUS_SUCCESS),
- ACTION_SUCCESS(emu_remote_connect_hci_action, &bearer_type),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN2_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_disconnect_action,
- &app1_conn2_req),
- CALLBACK_GATTC_DISCONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN2_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_stop_listen_action,
- &app1_conn_req),
- CALLBACK_STATUS(CB_GATTC_LISTEN, GATT_STATUS_SUCCESS),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Search Service - Single",
- ACTION_SUCCESS(init_pdus, search_service),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_RESULT(CONN1_ID, &service_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Search Service - Multiple",
- ACTION_SUCCESS(init_pdus, search_service_2),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_RESULT(CONN1_ID, &service_1),
- CALLBACK_GATTC_SEARCH_RESULT(CONN1_ID, &service_2),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Search Service - None",
- ACTION_SUCCESS(init_pdus, search_service_3),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Search Service - Incorrect rsp",
- ACTION_SUCCESS(init_pdus, search_service_4),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Get Characteristic - Single",
- ACTION_SUCCESS(init_pdus, get_characteristic_1),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_characteristic_action,
- &get_char_data_1),
- CALLBACK_GATTC_GET_CHARACTERISTIC_CB(GATT_STATUS_SUCCESS,
- CONN1_ID, &service_1, &characteristic_1, 4),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Get Characteristic - Incorrect rsp",
- ACTION_SUCCESS(init_pdus, get_characteristic_2),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_characteristic_action,
- &get_char_data_1),
- CALLBACK_GATTC_GET_CHARACTERISTIC_CB(GATT_STATUS_FAILURE,
- CONN1_ID, &service_1, NULL, 0),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Get Characteristic - None",
- ACTION_SUCCESS(init_pdus, get_characteristic_1),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_FAIL(gatt_client_get_characteristic_action,
- &get_char_data_2),
- CALLBACK_GATTC_GET_CHARACTERISTIC_CB(GATT_STATUS_FAILURE,
- CONN1_ID, &service_2,
- NULL, 0),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Get Descriptor - Incorrect rsp",
- ACTION_SUCCESS(init_pdus, get_descriptor_0),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_characteristic_action,
- &get_char_data_1),
- CALLBACK_GATTC_GET_CHARACTERISTIC_CB(GATT_STATUS_SUCCESS,
- CONN1_ID, &service_1, &characteristic_1, 4),
- ACTION_SUCCESS(gatt_client_get_descriptor_action,
- &get_desc_data_1),
- CALLBACK_GATTC_GET_DESCRIPTOR(GATT_STATUS_FAILURE, CONN1_ID,
- &service_1, &characteristic_1, NULL),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Get Descriptor - Single",
- ACTION_SUCCESS(init_pdus, get_descriptor_1),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_characteristic_action,
- &get_char_data_1),
- CALLBACK_GATTC_GET_CHARACTERISTIC_CB(GATT_STATUS_SUCCESS,
- CONN1_ID, &service_1, &characteristic_1, 4),
- ACTION_SUCCESS(gatt_client_get_descriptor_action,
- &get_desc_data_1),
- CALLBACK_GATTC_GET_DESCRIPTOR(GATT_STATUS_SUCCESS, CONN1_ID,
- &service_1, &characteristic_1, &desc_1),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Get Descriptor - Multiple",
- ACTION_SUCCESS(init_pdus, get_descriptor_2),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_characteristic_action,
- &get_char_data_1),
- CALLBACK_GATTC_GET_CHARACTERISTIC_CB(GATT_STATUS_SUCCESS,
- CONN1_ID, &service_1,
- &characteristic_1, 4),
- ACTION_SUCCESS(gatt_client_get_descriptor_action,
- &get_desc_data_1),
- CALLBACK_GATTC_GET_DESCRIPTOR(GATT_STATUS_SUCCESS, CONN1_ID,
- &service_1, &characteristic_1,
- &desc_1),
- ACTION_SUCCESS(gatt_client_get_descriptor_action,
- &get_desc_data_2),
- CALLBACK_GATTC_GET_DESCRIPTOR(GATT_STATUS_SUCCESS, CONN1_ID,
- &service_1, &characteristic_1,
- &desc_2),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Get Descriptor - None",
- ACTION_SUCCESS(init_pdus, get_descriptor_3),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_characteristic_action,
- &get_char_data_1),
- CALLBACK_GATTC_GET_CHARACTERISTIC_CB(GATT_STATUS_SUCCESS,
- CONN1_ID, &service_1, &characteristic_1, 4),
- ACTION_SUCCESS(gatt_client_get_descriptor_action,
- &get_desc_data_1),
- CALLBACK_GATTC_GET_DESCRIPTOR(GATT_STATUS_FAILURE, CONN1_ID,
- &service_1, &characteristic_1, NULL),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Get Included Services - Incorrect rsp",
- ACTION_SUCCESS(init_pdus, get_included_0),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_included_action,
- &get_incl_data_1),
- CALLBACK_GATTC_GET_INCLUDED(GATT_STATUS_FAILURE, CONN1_ID,
- &service_1, NULL),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Get Included Service - 16 UUID",
- ACTION_SUCCESS(init_pdus, get_included_1),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_included_action,
- &get_incl_data_1),
- CALLBACK_GATTC_GET_INCLUDED(GATT_STATUS_SUCCESS, CONN1_ID,
- &service_1, &included_1),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Get Included Service - 128 UUID",
- ACTION_SUCCESS(init_pdus, get_included_2),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_included_action,
- &get_incl_data_1),
- CALLBACK_GATTC_GET_INCLUDED(GATT_STATUS_SUCCESS, CONN1_ID,
- &service_1, &included_2),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Get Included Service - None",
- ACTION_SUCCESS(init_pdus, get_included_3),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_included_action,
- &get_incl_data_1),
- CALLBACK_GATTC_GET_INCLUDED(GATT_STATUS_FAILURE, CONN1_ID,
- &service_1, NULL),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Read Characteristic - Success",
- ACTION_SUCCESS(init_pdus, read_characteristic_1),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(init_read_params_action, &set_read_param_1),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_characteristic_action,
- &get_char_data_1),
- CALLBACK_GATTC_GET_CHARACTERISTIC_CB(GATT_STATUS_SUCCESS,
- CONN1_ID, &service_1, &characteristic_1, 4),
- ACTION_SUCCESS(gatt_client_read_characteristic_action,
- &read_char_data_1),
- CALLBACK_GATTC_READ_CHARACTERISTIC(GATT_STATUS_SUCCESS,
- CONN1_ID, &read_params_1),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Read Characteristic - Insuf. Auth.",
- ACTION_SUCCESS(init_pdus, read_characteristic_2),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(init_read_params_action, &set_read_param_2),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_characteristic_action,
- &get_char_data_1),
- CALLBACK_GATTC_GET_CHARACTERISTIC_CB(GATT_STATUS_SUCCESS,
- CONN1_ID, &service_1, &characteristic_1, 4),
- ACTION_SUCCESS(gatt_client_read_characteristic_action,
- &read_char_data_1),
- CALLBACK_GATTC_READ_CHARACTERISTIC(GATT_STATUS_INS_AUTH,
- CONN1_ID, &read_params_1),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Read Characteristic - Wrong params",
- ACTION_SUCCESS(init_pdus, read_characteristic_2),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(init_read_params_action, &set_read_param_3),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_characteristic_action,
- &get_char_data_1),
- CALLBACK_GATTC_GET_CHARACTERISTIC_CB(GATT_STATUS_SUCCESS,
- CONN1_ID, &service_1, &characteristic_1, 4),
- ACTION_FAIL(gatt_client_read_characteristic_action,
- &read_char_data_2),
- CALLBACK_GATTC_READ_CHARACTERISTIC(GATT_STATUS_FAILURE,
- CONN1_ID, &read_params_1),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Read Descriptor - Success",
- ACTION_SUCCESS(init_pdus, read_descriptor_1),
- ACTION_SUCCESS(init_read_params_action, &set_read_param_4),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_characteristic_action,
- &get_char_data_1),
- CALLBACK_GATTC_GET_CHARACTERISTIC_CB(GATT_STATUS_SUCCESS,
- CONN1_ID, &service_1, &characteristic_1, 4),
- ACTION_SUCCESS(gatt_client_get_descriptor_action,
- &get_desc_data_1),
- CALLBACK_GATTC_GET_DESCRIPTOR(GATT_STATUS_SUCCESS, CONN1_ID,
- &service_1, &characteristic_1, &desc_1),
- ACTION_SUCCESS(gatt_client_read_descriptor_action,
- &read_desc_data_1),
- CALLBACK_GATTC_READ_DESCRIPTOR(GATT_STATUS_SUCCESS,
- CONN1_ID, &read_params_1),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Read Descriptor - Insuf. Auth.",
- ACTION_SUCCESS(init_pdus, read_descriptor_2),
- ACTION_SUCCESS(init_read_params_action, &set_read_param_5),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_characteristic_action,
- &get_char_data_1),
- CALLBACK_GATTC_GET_CHARACTERISTIC_CB(GATT_STATUS_SUCCESS,
- CONN1_ID, &service_1, &characteristic_1, 4),
- ACTION_SUCCESS(gatt_client_get_descriptor_action,
- &get_desc_data_1),
- CALLBACK_GATTC_GET_DESCRIPTOR(GATT_STATUS_SUCCESS, CONN1_ID,
- &service_1, &characteristic_1, &desc_1),
- ACTION_SUCCESS(gatt_client_read_descriptor_action,
- &read_desc_data_1),
- CALLBACK_GATTC_READ_DESCRIPTOR(GATT_STATUS_INS_AUTH,
- CONN1_ID, &read_params_1),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Read Descriptor - Wrong params",
- ACTION_SUCCESS(init_pdus, read_descriptor_2),
- ACTION_SUCCESS(init_read_params_action, &set_read_param_6),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_characteristic_action,
- &get_char_data_1),
- CALLBACK_GATTC_GET_CHARACTERISTIC_CB(GATT_STATUS_SUCCESS,
- CONN1_ID, &service_1, &characteristic_1, 4),
- ACTION_SUCCESS(gatt_client_get_descriptor_action,
- &get_desc_data_1),
- CALLBACK_GATTC_GET_DESCRIPTOR(GATT_STATUS_SUCCESS, CONN1_ID,
- &service_1, &characteristic_1, &desc_1),
- ACTION_FAIL(gatt_client_read_descriptor_action,
- &read_desc_data_2),
- CALLBACK_GATTC_READ_DESCRIPTOR(GATT_STATUS_FAILURE,
- CONN1_ID, &read_params_1),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Write Characteristic Cmd - Success",
- ACTION_SUCCESS(init_pdus, write_characteristic_1),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(init_write_params_action, &set_write_param_1),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_characteristic_action,
- &get_char_data_1),
- CALLBACK_GATTC_GET_CHARACTERISTIC_CB(GATT_STATUS_SUCCESS,
- CONN1_ID, &service_1, &characteristic_1, 4),
- ACTION_SUCCESS(gatt_client_write_characteristic_action,
- &write_char_data_1),
- CALLBACK_GATTC_WRITE_CHARACTERISTIC(GATT_STATUS_SUCCESS,
- CONN1_ID, &write_params_1),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Write Characteristic Req - Success",
- ACTION_SUCCESS(init_pdus, write_characteristic_2),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(init_write_params_action, &set_write_param_1),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_characteristic_action,
- &get_char_data_1),
- CALLBACK_GATTC_GET_CHARACTERISTIC_CB(GATT_STATUS_SUCCESS,
- CONN1_ID, &service_1, &characteristic_1, 4),
- ACTION_SUCCESS(gatt_client_write_characteristic_action,
- &write_char_data_2),
- CALLBACK_GATTC_WRITE_CHARACTERISTIC(GATT_STATUS_SUCCESS,
- CONN1_ID, &write_params_1),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Write Characteristic - Insuf. Auth.",
- ACTION_SUCCESS(init_pdus, write_characteristic_3),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(init_write_params_action, &set_write_param_2),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_characteristic_action,
- &get_char_data_1),
- CALLBACK_GATTC_GET_CHARACTERISTIC_CB(GATT_STATUS_SUCCESS,
- CONN1_ID, &service_1, &characteristic_1, 4),
- ACTION_SUCCESS(gatt_client_write_characteristic_action,
- &write_char_data_2),
- CALLBACK_GATTC_WRITE_CHARACTERISTIC(GATT_STATUS_INS_AUTH,
- CONN1_ID, &write_params_1),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Write Characteristic - Wrong Params",
- ACTION_SUCCESS(init_pdus, write_characteristic_3),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(init_write_params_action, &set_write_param_3),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_FAIL(gatt_client_write_characteristic_action,
- &write_char_data_2),
- CALLBACK_GATTC_WRITE_CHARACTERISTIC(GATT_STATUS_FAILURE,
- CONN1_ID, &write_params_1),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Register For Notification - Success",
- ACTION_SUCCESS(init_pdus, notification_1),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_characteristic_action,
- &get_char_data_1),
- CALLBACK_GATTC_GET_CHARACTERISTIC_CB(GATT_STATUS_SUCCESS,
- CONN1_ID, &service_1, &characteristic_1, 4),
- ACTION_SUCCESS(gatt_client_register_for_notification_action,
- ¬if_data_1),
- CALLBACK_GATTC_REGISTER_FOR_NOTIF(GATT_STATUS_SUCCESS, CONN1_ID,
- &characteristic_1,
- &service_1, 1),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Deregister For Notification - Success",
- ACTION_SUCCESS(init_pdus, notification_1),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_characteristic_action,
- &get_char_data_1),
- CALLBACK_GATTC_GET_CHARACTERISTIC_CB(GATT_STATUS_SUCCESS,
- CONN1_ID, &service_1, &characteristic_1, 4),
- ACTION_SUCCESS(gatt_client_register_for_notification_action,
- ¬if_data_1),
- CALLBACK_GATTC_REGISTER_FOR_NOTIF(GATT_STATUS_SUCCESS, CONN1_ID,
- &characteristic_1,
- &service_1, 1),
- ACTION_SUCCESS(gatt_client_deregister_for_notification_action,
- ¬if_data_1),
- CALLBACK_GATTC_REGISTER_FOR_NOTIF(GATT_STATUS_SUCCESS, CONN1_ID,
- &characteristic_1,
- &service_1, 0),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Register For Notification - Indicate",
- ACTION_SUCCESS(init_pdus, notification_2),
- ACTION_SUCCESS(init_notify_params_action, &set_notify_param_1),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_characteristic_action,
- &get_char_data_1),
- CALLBACK_GATTC_GET_CHARACTERISTIC_CB(GATT_STATUS_SUCCESS,
- CONN1_ID, &service_1, &characteristic_1, 4),
- ACTION_SUCCESS(gatt_client_register_for_notification_action,
- ¬if_data_1),
- CALLBACK_GATTC_REGISTER_FOR_NOTIF(GATT_STATUS_SUCCESS, CONN1_ID,
- &characteristic_1,
- &service_1, 1),
- ACTION_SUCCESS(gatt_remote_send_frame_action, NULL),
- CALLBACK_GATTC_NOTIFY(CONN1_ID, ¬ify_params_1),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Register For Notification - Notify",
- ACTION_SUCCESS(init_pdus, notification_3),
- ACTION_SUCCESS(init_notify_params_action, &set_notify_param_2),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_characteristic_action,
- &get_char_data_1),
- CALLBACK_GATTC_GET_CHARACTERISTIC_CB(GATT_STATUS_SUCCESS,
- CONN1_ID, &service_1, &characteristic_1, 4),
- ACTION_SUCCESS(gatt_client_register_for_notification_action,
- ¬if_data_1),
- CALLBACK_GATTC_REGISTER_FOR_NOTIF(GATT_STATUS_SUCCESS, CONN1_ID,
- &characteristic_1,
- &service_1, 1),
- ACTION_SUCCESS(gatt_remote_send_frame_action, NULL),
- CALLBACK_GATTC_NOTIFY(CONN1_ID, ¬ify_params_1),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Write Descriptor - Success",
- ACTION_SUCCESS(init_pdus, write_descriptor_1),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(init_write_params_action, &set_write_param_4),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_characteristic_action,
- &get_char_data_1),
- CALLBACK_GATTC_GET_CHARACTERISTIC_CB(GATT_STATUS_SUCCESS,
- CONN1_ID, &service_1, &characteristic_1, 4),
- ACTION_SUCCESS(gatt_client_get_descriptor_action,
- &get_desc_data_1),
- CALLBACK_GATTC_GET_DESCRIPTOR(GATT_STATUS_SUCCESS, CONN1_ID,
- &service_1, &characteristic_1, &desc_1),
- ACTION_SUCCESS(gatt_client_write_descriptor_action,
- &write_desc_data_1),
- CALLBACK_GATTC_WRITE_DESCRIPTOR(GATT_STATUS_SUCCESS,
- CONN1_ID, &write_params_1),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Write Descriptor - Insuf. Auth.",
- ACTION_SUCCESS(init_pdus, write_descriptor_2),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(init_write_params_action, &set_write_param_6),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_characteristic_action,
- &get_char_data_1),
- CALLBACK_GATTC_GET_CHARACTERISTIC_CB(GATT_STATUS_SUCCESS,
- CONN1_ID, &service_1, &characteristic_1, 4),
- ACTION_SUCCESS(gatt_client_get_descriptor_action,
- &get_desc_data_1),
- CALLBACK_GATTC_GET_DESCRIPTOR(GATT_STATUS_SUCCESS, CONN1_ID,
- &service_1, &characteristic_1, &desc_1),
- ACTION_SUCCESS(gatt_client_write_descriptor_action,
- &write_desc_data_1),
- CALLBACK_GATTC_WRITE_DESCRIPTOR(GATT_STATUS_INS_AUTH,
- CONN1_ID, &write_params_1),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Client - Write Descriptor - Wrong Param",
- ACTION_SUCCESS(init_pdus, write_descriptor_1),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(init_write_params_action, &set_write_param_5),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_client_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_client_start_scan_action, NULL),
- ACTION_SUCCESS(delayemu_setup_powered_remote_action, NULL),
- CLLBACK_GATTC_SCAN_RES(prop_emu_remotes_default_set, 1, TRUE),
- ACTION_SUCCESS(gatt_client_stop_scan_action, NULL),
- ACTION_SUCCESS(gatt_client_connect_action, &app1_conn_req),
- CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_client_search_services, &search_services_1),
- CALLBACK_GATTC_SEARCH_COMPLETE(GATT_STATUS_SUCCESS, CONN1_ID),
- ACTION_SUCCESS(gatt_client_get_characteristic_action,
- &get_char_data_1),
- CALLBACK_GATTC_GET_CHARACTERISTIC_CB(GATT_STATUS_SUCCESS,
- CONN1_ID, &service_1, &characteristic_1, 4),
- ACTION_SUCCESS(gatt_client_get_descriptor_action,
- &get_desc_data_1),
- CALLBACK_GATTC_GET_DESCRIPTOR(GATT_STATUS_SUCCESS, CONN1_ID,
- &service_1, &characteristic_1, &desc_1),
- ACTION_FAIL(gatt_client_write_descriptor_action,
- &write_desc_data_2),
- CALLBACK_GATTC_WRITE_DESCRIPTOR(GATT_STATUS_FAILURE,
- CONN1_ID, &write_params_1),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Register",
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Unregister",
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_server_unregister_action,
- INT_TO_PTR(APP1_ID)),
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ),
- TEST_CASE_BREDRLE("Gatt Server - LE Connect",
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(bt_start_discovery_action, NULL),
- CALLBACK_STATE(CB_BT_DISCOVERY_STATE_CHANGED,
- BT_DISCOVERY_STARTED),
- ACTION_SUCCESS(emu_setup_powered_remote_action, NULL),
- CALLBACK_DEVICE_FOUND(prop_emu_remotes_default_le_set, 2),
- ACTION_SUCCESS(bt_cancel_discovery_action, NULL),
- ACTION_SUCCESS(gatt_server_connect_action, &app1_conn_req),
- CALLBACK_GATTS_CONNECTION(GATT_SERVER_CONNECTED,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Server - LE Disconnect",
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(bt_start_discovery_action, NULL),
- CALLBACK_STATE(CB_BT_DISCOVERY_STATE_CHANGED,
- BT_DISCOVERY_STARTED),
- ACTION_SUCCESS(emu_setup_powered_remote_action, NULL),
- CALLBACK_DEVICE_FOUND(prop_emu_remotes_default_le_set, 2),
- ACTION_SUCCESS(bt_cancel_discovery_action, NULL),
- ACTION_SUCCESS(gatt_server_connect_action, &app1_conn_req),
- CALLBACK_GATTS_CONNECTION(GATT_SERVER_CONNECTED,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_server_disconnect_action,
- &app1_conn_req),
- CALLBACK_GATTS_CONNECTION(GATT_SERVER_DISCONNECTED,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Server - LE Multiple Server Conn./Disc",
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_server_register_action, &app2_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(bt_start_discovery_action, NULL),
- CALLBACK_STATE(CB_BT_DISCOVERY_STATE_CHANGED,
- BT_DISCOVERY_STARTED),
- ACTION_SUCCESS(emu_setup_powered_remote_action, NULL),
- CALLBACK_DEVICE_FOUND(prop_emu_remotes_default_le_set, 2),
- ACTION_SUCCESS(bt_cancel_discovery_action, NULL),
- ACTION_SUCCESS(gatt_server_connect_action, &app1_conn_req),
- CALLBACK_GATTS_CONNECTION(GATT_SERVER_CONNECTED,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_server_connect_action, &app2_conn_req),
- CALLBACK_GATTS_CONNECTION(GATT_SERVER_CONNECTED,
- prop_emu_remotes_default_set,
- CONN2_ID, APP2_ID),
- ACTION_SUCCESS(gatt_server_disconnect_action, &app2_conn_req),
- CALLBACK_GATTS_CONNECTION(GATT_SERVER_DISCONNECTED,
- prop_emu_remotes_default_set,
- CONN2_ID, APP2_ID),
- ACTION_SUCCESS(gatt_server_disconnect_action, &app1_conn_req),
- CALLBACK_GATTS_CONNECTION(GATT_SERVER_DISCONNECTED,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Add Single Service Successful",
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_service_data_1),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &service_add_1, NULL, NULL),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Add Multiple Services Successful",
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_service_data_1),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &service_add_1, NULL, NULL),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_service_data_2),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &service_add_2, NULL, NULL),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_service_data_3),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &service_add_3, NULL, NULL),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Add Service with 0 handles",
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_FAIL(gatt_server_add_service_action,
- &add_bad_service_data_1),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_FAILURE, APP1_ID,
- &service_add_1, NULL, NULL),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Add Secondary Service",
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_sec_service_data_1),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &included_1, NULL, NULL),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Add Included Service Successful",
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_service_data_4),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &service_add_1, NULL,
- &srvc1_handle),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_service_data_4),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &service_add_1, NULL,
- &inc_srvc1_handle),
- ACTION_SUCCESS(gatt_server_add_inc_service_action,
- &add_inc_service_data_1),
- CALLBACK_GATTS_INC_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &srvc1_handle, NULL),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Add Inc. Service with wrong handle",
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_service_data_4),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &service_add_1, NULL,
- &srvc1_handle),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_service_data_4),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &service_add_1, NULL, NULL),
- ACTION_FAIL(gatt_server_add_inc_service_action,
- &add_bad_inc_service_data_1),
- CALLBACK_GATTS_INC_SERVICE_ADDED(GATT_STATUS_FAILURE, APP1_ID,
- &srvc1_handle, NULL),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Add Single Characteristic Successful",
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_service_data_5),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &service_add_1, NULL,
- &srvc1_handle),
- ACTION_SUCCESS(gatt_server_add_char_action, &add_char_data_1),
- CALLBACK_GATTS_CHARACTERISTIC_ADDED(GATT_STATUS_SUCCESS,
- APP1_ID, &app1_uuid,
- &srvc1_handle, NULL,
- NULL),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Add Char. wrong service handle",
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_service_data_5),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &service_add_1, NULL,
- &srvc1_handle),
- ACTION_FAIL(gatt_server_add_char_action, &add_bad_char_data_1),
- CALLBACK_GATTS_CHARACTERISTIC_ADDED(GATT_STATUS_FAILURE,
- APP1_ID, &app1_uuid,
- NULL, NULL, NULL),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Add Single Descriptor Successful",
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_service_data_6),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &service_add_1, NULL,
- &srvc1_handle),
- ACTION_SUCCESS(gatt_server_add_char_action, &add_char_data_1),
- CALLBACK_GATTS_CHARACTERISTIC_ADDED(GATT_STATUS_SUCCESS,
- APP1_ID, &app1_uuid,
- &srvc1_handle, NULL,
- NULL),
- ACTION_SUCCESS(gatt_server_add_desc_action, &add_desc_data_1),
- CALLBACK_GATTS_DESCRIPTOR_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &app2_uuid, &srvc1_handle,
- NULL, NULL),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Add Desc. wrong service handle",
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_service_data_6),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &service_add_1, NULL,
- &srvc1_handle),
- ACTION_SUCCESS(gatt_server_add_char_action, &add_char_data_1),
- CALLBACK_GATTS_CHARACTERISTIC_ADDED(GATT_STATUS_SUCCESS,
- APP1_ID, &app1_uuid,
- &srvc1_handle, NULL,
- NULL),
- ACTION_FAIL(gatt_server_add_desc_action, &add_bad_desc_data_1),
- CALLBACK_GATTS_DESCRIPTOR_ADDED(GATT_STATUS_FAILURE, APP1_ID,
- &app2_uuid, NULL, NULL, NULL),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Add Desc. wrong app ID",
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_service_data_6),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &service_add_1, NULL,
- &srvc1_handle),
- ACTION_SUCCESS(gatt_server_add_char_action, &add_char_data_1),
- CALLBACK_GATTS_CHARACTERISTIC_ADDED(GATT_STATUS_SUCCESS,
- APP1_ID, &app1_uuid,
- &srvc1_handle, NULL,
- NULL),
- ACTION_FAIL(gatt_server_add_desc_action, &add_bad_desc_data_2),
- CALLBACK_GATTS_DESCRIPTOR_ADDED(GATT_STATUS_FAILURE, APP2_ID,
- &app2_uuid, NULL, NULL, NULL),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Start Service Successful BREDRLE",
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_service_data_1),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &service_add_1, NULL,
- &srvc1_handle),
- ACTION_SUCCESS(gatt_server_start_srvc_action,
- &start_srvc_data_1),
- CALLBACK_GATTS_SERVICE_STARTED(GATT_STATUS_SUCCESS, APP1_ID,
- &srvc1_handle),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Start Service Successful LE",
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_service_data_1),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &service_add_1, NULL,
- &srvc1_handle),
- ACTION_SUCCESS(gatt_server_start_srvc_action,
- &start_srvc_data_2),
- CALLBACK_GATTS_SERVICE_STARTED(GATT_STATUS_SUCCESS, APP1_ID,
- &srvc1_handle),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Start Service wrong service handle",
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_service_data_1),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &service_add_1, NULL, NULL),
- ACTION_FAIL(gatt_server_start_srvc_action,
- &start_bad_srvc_data_1),
- CALLBACK_GATTS_SERVICE_STARTED(GATT_STATUS_FAILURE, APP1_ID,
- NULL),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Start Service wrong server transport",
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_service_data_1),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &service_add_1, NULL,
- &srvc1_handle),
- ACTION_FAIL(gatt_server_start_srvc_action,
- &start_bad_srvc_data_2),
- CALLBACK_GATTS_SERVICE_STARTED(GATT_STATUS_FAILURE, APP1_ID,
- &srvc1_handle),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Stop Service Successful",
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_service_data_1),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &service_add_1, NULL,
- &srvc1_handle),
- ACTION_SUCCESS(gatt_server_start_srvc_action,
- &start_srvc_data_1),
- CALLBACK_GATTS_SERVICE_STARTED(GATT_STATUS_SUCCESS, APP1_ID,
- &srvc1_handle),
- ACTION_SUCCESS(gatt_server_stop_srvc_action, &stop_srvc_data_1),
- CALLBACK_GATTS_SERVICE_STOPPED(GATT_STATUS_SUCCESS, APP1_ID,
- &srvc1_handle),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Stop Service wrong service handle",
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_service_data_1),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &service_add_1, NULL,
- &srvc1_handle),
- ACTION_SUCCESS(gatt_server_start_srvc_action,
- &start_srvc_data_1),
- CALLBACK_GATTS_SERVICE_STARTED(GATT_STATUS_SUCCESS, APP1_ID,
- &srvc1_handle),
- ACTION_FAIL(gatt_server_stop_srvc_action,
- &stop_bad_srvc_data_1),
- CALLBACK_GATTS_SERVICE_STOPPED(GATT_STATUS_FAILURE, APP1_ID,
- NULL),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Delete Service Successful",
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_service_data_1),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &service_add_1, NULL,
- &srvc1_handle),
- ACTION_SUCCESS(gatt_server_delete_srvc_action,
- &delete_srvc_data_1),
- CALLBACK_GATTS_SERVICE_DELETED(GATT_STATUS_SUCCESS, APP1_ID,
- &srvc1_handle),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Delete Service wrong handle",
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_service_data_1),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &service_add_1, NULL,
- &srvc1_handle),
- ACTION_FAIL(gatt_server_delete_srvc_action,
- &delete_bad_srvc_data_1),
- CALLBACK_GATTS_SERVICE_DELETED(GATT_STATUS_FAILURE, APP1_ID,
- NULL),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Send Indication",
- ACTION_SUCCESS(init_pdus, send_indication_1),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(bt_start_discovery_action, NULL),
- CALLBACK_STATE(CB_BT_DISCOVERY_STATE_CHANGED,
- BT_DISCOVERY_STARTED),
- ACTION_SUCCESS(emu_setup_powered_remote_action, NULL),
- CALLBACK_DEVICE_FOUND(prop_emu_remotes_default_le_set, 2),
- ACTION_SUCCESS(bt_cancel_discovery_action, NULL),
- ACTION_SUCCESS(gatt_server_connect_action, &app1_conn_req),
- CALLBACK_GATTS_CONNECTION(GATT_SERVER_CONNECTED,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_server_send_indication_action,
- &send_indication_data_1),
- CALLBACK(CB_EMU_VALUE_INDICATION),
- CALLBACK_GATTS_NOTIF_CONF(CONN1_ID, GATT_STATUS_SUCCESS),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Send Notification",
- ACTION_SUCCESS(init_pdus, send_notification_1),
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(bt_start_discovery_action, NULL),
- CALLBACK_STATE(CB_BT_DISCOVERY_STATE_CHANGED,
- BT_DISCOVERY_STARTED),
- ACTION_SUCCESS(emu_setup_powered_remote_action, NULL),
- CALLBACK_DEVICE_FOUND(prop_emu_remotes_default_le_set, 2),
- ACTION_SUCCESS(bt_cancel_discovery_action, NULL),
- ACTION_SUCCESS(gatt_server_connect_action, &app1_conn_req),
- CALLBACK_GATTS_CONNECTION(GATT_SERVER_CONNECTED,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_SUCCESS(gatt_server_send_indication_action,
- &send_indication_data_2),
- CALLBACK_GATTS_NOTIF_CONF(CONN1_ID, GATT_STATUS_SUCCESS),
- CALLBACK(CB_EMU_VALUE_NOTIFICATION),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Send Notification, wrong conn id",
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(bt_start_discovery_action, NULL),
- CALLBACK_STATE(CB_BT_DISCOVERY_STATE_CHANGED,
- BT_DISCOVERY_STARTED),
- ACTION_SUCCESS(emu_setup_powered_remote_action, NULL),
- CALLBACK_DEVICE_FOUND(prop_emu_remotes_default_le_set, 2),
- ACTION_SUCCESS(bt_cancel_discovery_action, NULL),
- ACTION_SUCCESS(gatt_server_connect_action, &app1_conn_req),
- CALLBACK_GATTS_CONNECTION(GATT_SERVER_CONNECTED,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- ACTION_FAIL(gatt_server_send_indication_action,
- &send_bad_indication_data_1),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Send response to read char request",
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_service_data_5),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &service_add_1, NULL,
- &srvc1_handle),
- ACTION_SUCCESS(gatt_server_add_char_action, &add_char_data_1),
- CALLBACK_GATTS_CHARACTERISTIC_ADDED(GATT_STATUS_SUCCESS,
- APP1_ID, &app1_uuid,
- &srvc1_handle, NULL,
- &char1_handle),
- ACTION_SUCCESS(gatt_server_start_srvc_action,
- &start_srvc_data_2),
- CALLBACK_GATTS_SERVICE_STARTED(GATT_STATUS_SUCCESS, APP1_ID,
- &srvc1_handle),
- ACTION_SUCCESS(bt_start_discovery_action, NULL),
- CALLBACK_STATE(CB_BT_DISCOVERY_STATE_CHANGED,
- BT_DISCOVERY_STARTED),
- ACTION_SUCCESS(emu_setup_powered_remote_action, NULL),
- CALLBACK_DEVICE_FOUND(prop_emu_remotes_default_le_set, 2),
- ACTION_SUCCESS(bt_cancel_discovery_action, NULL),
- ACTION_SUCCESS(gatt_server_connect_action, &app1_conn_req),
- CALLBACK_GATTS_CONNECTION(GATT_SERVER_CONNECTED,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- PROCESS_DATA(GATT_STATUS_SUCCESS,
- gatt_remote_send_raw_pdu_action,
- &att_read_req_op_v, &char1_handle_v, NULL),
- CALLBACK_GATTS_REQUEST_READ(CONN1_ID, TRANS1_ID,
- prop_emu_remotes_default_set,
- &char1_handle, 0, false),
- ACTION_SUCCESS(gatt_server_send_response_action,
- &send_resp_data_1),
- CALLBACK(CB_EMU_READ_RESPONSE),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Send response to write char request",
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_service_data_5),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &service_add_1, NULL,
- &srvc1_handle),
- ACTION_SUCCESS(gatt_server_add_char_action, &add_char_data_2),
- CALLBACK_GATTS_CHARACTERISTIC_ADDED(GATT_STATUS_SUCCESS,
- APP1_ID, &app1_uuid,
- &srvc1_handle, NULL,
- &char1_handle),
- ACTION_SUCCESS(gatt_server_start_srvc_action,
- &start_srvc_data_2),
- CALLBACK_GATTS_SERVICE_STARTED(GATT_STATUS_SUCCESS, APP1_ID,
- &srvc1_handle),
- ACTION_SUCCESS(bt_start_discovery_action, NULL),
- CALLBACK_STATE(CB_BT_DISCOVERY_STATE_CHANGED,
- BT_DISCOVERY_STARTED),
- ACTION_SUCCESS(emu_setup_powered_remote_action, NULL),
- CALLBACK_DEVICE_FOUND(prop_emu_remotes_default_le_set, 2),
- ACTION_SUCCESS(bt_cancel_discovery_action, NULL),
- ACTION_SUCCESS(gatt_server_connect_action, &app1_conn_req),
- CALLBACK_GATTS_CONNECTION(GATT_SERVER_CONNECTED,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- PROCESS_DATA(GATT_STATUS_SUCCESS,
- gatt_remote_send_raw_pdu_action,
- &att_write_req_op_v, &char1_handle_v,
- &att_write_req_value_1_v),
- CALLBACK_GATTS_REQUEST_WRITE(CONN1_ID, TRANS1_ID,
- prop_emu_remotes_default_set,
- &char1_handle, 0,
- sizeof(att_write_req_value_1),
- true, false,
- att_write_req_value_1),
- ACTION_SUCCESS(gatt_server_send_response_action,
- &send_resp_data_2),
- CALLBACK(CB_EMU_WRITE_RESPONSE),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Find By Type - Attribute not found",
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_service_data_5),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &service_add_1, NULL,
- &srvc1_handle),
- ACTION_SUCCESS(gatt_server_add_char_action, &add_char_data_2),
- CALLBACK_GATTS_CHARACTERISTIC_ADDED(GATT_STATUS_SUCCESS,
- APP1_ID, &app1_uuid,
- &srvc1_handle, NULL,
- &char1_handle),
- ACTION_SUCCESS(gatt_server_start_srvc_action,
- &start_srvc_data_2),
- CALLBACK_GATTS_SERVICE_STARTED(GATT_STATUS_SUCCESS, APP1_ID,
- &srvc1_handle),
- ACTION_SUCCESS(bt_start_discovery_action, NULL),
- CALLBACK_STATE(CB_BT_DISCOVERY_STATE_CHANGED,
- BT_DISCOVERY_STARTED),
- ACTION_SUCCESS(emu_setup_powered_remote_action, NULL),
- CALLBACK_DEVICE_FOUND(prop_emu_remotes_default_le_set, 2),
- ACTION_SUCCESS(bt_cancel_discovery_action, NULL),
- ACTION_SUCCESS(gatt_server_connect_action, &app1_conn_req),
- CALLBACK_GATTS_CONNECTION(GATT_SERVER_CONNECTED,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- PROCESS_DATA(GATT_STATUS_SUCCESS,
- gatt_remote_send_raw_pdu_action,
- &att_find_by_type_req_op_v,
- &search_range_1,
- &primary_type),
- CALLBACK_ERROR(CB_EMU_ATT_ERROR, 0x0a),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- /* This tests embeded ccc */
- TEST_CASE_BREDRLE("Gatt Server - Srvc change write req. success",
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(bt_start_discovery_action, NULL),
- CALLBACK_STATE(CB_BT_DISCOVERY_STATE_CHANGED,
- BT_DISCOVERY_STARTED),
- ACTION_SUCCESS(emu_setup_powered_remote_action, NULL),
- CALLBACK_DEVICE_FOUND(prop_emu_remotes_default_le_set, 2),
- ACTION_SUCCESS(bt_cancel_discovery_action, NULL),
- ACTION_SUCCESS(gatt_server_connect_action, &app1_conn_req),
- CALLBACK_GATTS_CONNECTION(GATT_SERVER_CONNECTED,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- /* For CCC we need to be bonded */
- ACTION_SUCCESS(bt_create_bond_action,
- &prop_test_remote_ble_bdaddr_req),
- CALLBACK_BOND_STATE(BT_BOND_STATE_BONDED,
- &prop_emu_remotes_default_set[0], 1),
- /* Write and receive confirmation */
- PROCESS_DATA(GATT_STATUS_SUCCESS,
- gatt_remote_send_raw_pdu_action,
- &att_write_req_op_v, &svc_change_ccc_handle_v,
- &svc_change_ccc_value_v),
- CALLBACK(CB_EMU_WRITE_RESPONSE),
- /* Shutdown */
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- TEST_CASE_BREDRLE("Gatt Server - Send error resp to write char request",
- ACTION_SUCCESS(bluetooth_enable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
- ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
- ACTION_SUCCESS(emu_set_connect_cb_action, gatt_conn_cb),
- ACTION_SUCCESS(gatt_server_register_action, &app1_uuid),
- CALLBACK_STATUS(CB_GATTS_REGISTER_SERVER, BT_STATUS_SUCCESS),
- ACTION_SUCCESS(gatt_server_add_service_action,
- &add_service_data_5),
- CALLBACK_GATTS_SERVICE_ADDED(GATT_STATUS_SUCCESS, APP1_ID,
- &service_add_1, NULL,
- &srvc1_handle),
- ACTION_SUCCESS(gatt_server_add_char_action, &add_char_data_2),
- CALLBACK_GATTS_CHARACTERISTIC_ADDED(GATT_STATUS_SUCCESS,
- APP1_ID, &app1_uuid,
- &srvc1_handle, NULL,
- &char1_handle),
- ACTION_SUCCESS(gatt_server_start_srvc_action,
- &start_srvc_data_2),
- CALLBACK_GATTS_SERVICE_STARTED(GATT_STATUS_SUCCESS, APP1_ID,
- &srvc1_handle),
- ACTION_SUCCESS(bt_start_discovery_action, NULL),
- CALLBACK_STATE(CB_BT_DISCOVERY_STATE_CHANGED,
- BT_DISCOVERY_STARTED),
- ACTION_SUCCESS(emu_setup_powered_remote_action, NULL),
- CALLBACK_DEVICE_FOUND(prop_emu_remotes_default_le_set, 2),
- ACTION_SUCCESS(bt_cancel_discovery_action, NULL),
- ACTION_SUCCESS(gatt_server_connect_action, &app1_conn_req),
- CALLBACK_GATTS_CONNECTION(GATT_SERVER_CONNECTED,
- prop_emu_remotes_default_set,
- CONN1_ID, APP1_ID),
- PROCESS_DATA(GATT_STATUS_SUCCESS,
- gatt_remote_send_raw_pdu_action,
- &att_write_req_op_v, &char1_handle_v,
- &att_write_req_value_1_v),
- CALLBACK_GATTS_REQUEST_WRITE(CONN1_ID, TRANS1_ID,
- prop_emu_remotes_default_set,
- &char1_handle, 0,
- sizeof(att_write_req_value_1),
- true, false,
- att_write_req_value_1),
- ACTION_SUCCESS(gatt_server_send_response_action,
- &send_resp_data_2_error),
- CALLBACK_ERROR(CB_EMU_ATT_ERROR, GATT_ERR_INVAL_ATTR_VALUE_LEN),
- ACTION_SUCCESS(bluetooth_disable_action, NULL),
- CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
- ),
- };
- struct queue *get_gatt_tests(void)
- {
- uint16_t i = 0;
- list = queue_new();
- for (; i < sizeof(test_cases) / sizeof(test_cases[0]); ++i)
- queue_push_tail(list, &test_cases[i]);
- return list;
- }
- void remove_gatt_tests(void)
- {
- queue_destroy(list, NULL);
- }
|