1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639 |
- #include "bcomdef.h"
- #include "OSAL.h"
- #include "att.h"
- #include "gatt.h"
- #include "gatt_uuid.h"
- #include "gatt_profile_uuid.h"
- #include "linkdb.h"
- #include "gattservapp.h"
- #include "hidkbdservice.h"
- #include "peripheral.h"
- #include "hiddev.h"
- #include "battservice.h"
- CONST uint8 hidServUUID[ATT_BT_UUID_SIZE] =
- {
- LO_UINT16(HID_SERV_UUID), HI_UINT16(HID_SERV_UUID)
- };
- CONST uint8 hidBootKeyInputUUID[ATT_BT_UUID_SIZE] =
- {
- LO_UINT16(BOOT_KEY_INPUT_UUID), HI_UINT16(BOOT_KEY_INPUT_UUID)
- };
- CONST uint8 hidBootMouseInputUUID[ATT_BT_UUID_SIZE] =
- {
- LO_UINT16(BOOT_MOUSE_INPUT_UUID), HI_UINT16(BOOT_MOUSE_INPUT_UUID)
- };
- CONST uint8 hidBootKeyOutputUUID[ATT_BT_UUID_SIZE] =
- {
- LO_UINT16(BOOT_KEY_OUTPUT_UUID), HI_UINT16(BOOT_KEY_OUTPUT_UUID)
- };
- CONST uint8 hidInfoUUID[ATT_BT_UUID_SIZE] =
- {
- LO_UINT16(HID_INFORMATION_UUID), HI_UINT16(HID_INFORMATION_UUID)
- };
- CONST uint8 hidReportMapUUID[ATT_BT_UUID_SIZE] =
- {
- LO_UINT16(REPORT_MAP_UUID), HI_UINT16(REPORT_MAP_UUID)
- };
- CONST uint8 hidControlPointUUID[ATT_BT_UUID_SIZE] =
- {
- LO_UINT16(HID_CTRL_PT_UUID), HI_UINT16(HID_CTRL_PT_UUID)
- };
- CONST uint8 hidReportUUID[ATT_BT_UUID_SIZE] =
- {
- LO_UINT16(REPORT_UUID), HI_UINT16(REPORT_UUID)
- };
- CONST uint8 hidProtocolModeUUID[ATT_BT_UUID_SIZE] =
- {
- LO_UINT16(PROTOCOL_MODE_UUID), HI_UINT16(PROTOCOL_MODE_UUID)
- };
- static CONST uint8 hidInfo[HID_INFORMATION_LEN] =
- {
- LO_UINT16(0x0111), HI_UINT16(0x0111),
- 0x00,
- HID_KBD_FLAGS
- };
- #if FOLLOW_TI_MAP
- static CONST uint8 hidReportMap[] =
- {
- 0x05, 0x01,
- 0x09, 0x06,
- 0xA1, 0x01,
- 0x85, HID_RPT_ID_KEY_IN,
-
- 0x05, 0x07,
- 0x19, 0xE0,
- 0x29, 0xE7,
- 0x15, 0x00,
- 0x25, 0x01,
-
-
- 0x95, 0x08,
- 0x75, 0x01,
- 0x81, 0x02,
-
-
- 0x95, 0x01,
- 0x75, 0x08,
- 0x81, 0x01,
-
-
- 0x95, 0x05,
- 0x75, 0x01,
- 0x05, 0x08,
- 0x19, 0x01,
- 0x29, 0x05,
- 0x91, 0x02,
-
-
- 0x95, 0x01,
- 0x75, 0x03,
- 0x91, 0x01,
-
-
- 0x95, 0x06,
- 0x75, 0x08,
- 0x15, 0x00,
- 0x25, 0x65,
- 0x05, 0x07,
- 0x19, 0x00,
- 0x29, 0x65,
- 0x81, 0x00,
-
- 0xC0,
-
- 0x05, 0x0c,
- 0x09, 0x01,
- 0xa1, 0x01,
- 0x85, HID_RPT_ID_CC_IN,
-
- 0x09, 0x30,
- 0x09, 0xCD,
- 0x09, 0xB7,
- 0x09, 0xB5,
- 0x09, 0xB6,
- 0x09, 0xB3,
- 0x09, 0xB4,
- 0x09, 0xB2,
- 0x09, 0xE9,
- 0x09, 0xEA,
- 0x09, 0xE2,
- 0x15, 0x01,
- 0x25, 0x0B,
- 0x95, 0x01,
- 0x75, 0x08,
- 0x81, 0x00,
-
- 0xC0,
-
- 0x05, 0x0C,
- 0x09, 0x01,
- 0xA1, 0x01,
- 0x85, HID_RPT_ID_VOICE_START_IN,
- 0x15, 0x00,
- 0x26, 0xFF, 0x00,
- 0x75, 0x08,
- 0x95, 0x05,
- 0x09, 0x01,
- 0x81, 0x00,
- 0x85, HID_RPT_ID_VOICE_DATA_IN,
- 0x15, 0x00,
- 0x26, 0xFF, 0x00,
- 0x75, 0x08,
- 0x95, 0x14,
- 0x09, 0x01,
- 0x81, 0x00,
- 0xC0
- };
- #else
- static CONST uint8 hidReportMap[] =
- {
- 0x05, 0x01,
- 0x09, 0x02,
- 0xA1, 0x01,
- 0x85, HID_RPT_ID_MOUSE_IN,
- 0x09, 0x01,
- 0xA1, 0x00,
- 0x05, 0x09,
- 0x19, 0x01,
- 0x29, 0x03,
- 0x15, 0x00,
- 0x25, 0x01,
- 0x75, 0x01,
- 0x95, 0x03,
- 0x81, 0x02,
- 0x75, 0x05,
- 0x95, 0x01,
- 0x81, 0x01,
- 0x05, 0x01,
- 0x09, 0x30,
- 0x09, 0x31,
- 0x09, 0x38,
- 0x15, 0x81,
- 0x25, 0x7F,
- 0x75, 0x08,
- 0x95, 0x03,
- 0x81, 0x06,
- 0xC0,
- 0xC0,
- 0x05, 0x01,
- 0x09, 0x06,
- 0xA1, 0x01,
- 0x85, HID_RPT_ID_KEY_IN,
-
- 0x05, 0x07,
- 0x19, 0xE0,
- 0x29, 0xE7,
- 0x15, 0x00,
- 0x25, 0x01,
-
-
- 0x75, 0x01,
- 0x95, 0x08,
- 0x81, 0x02,
-
-
- 0x95, 0x01,
- 0x75, 0x08,
- 0x81, 0x01,
-
-
- 0x95, 0x05,
- 0x75, 0x01,
- 0x05, 0x08,
- 0x19, 0x01,
- 0x29, 0x05,
- 0x91, 0x02,
-
-
- 0x95, 0x01,
- 0x75, 0x03,
- 0x91, 0x01,
-
-
- 0x95, 0x06,
- 0x75, 0x08,
- 0x15, 0x00,
- 0x25, 0x65,
- 0x05, 0x07,
- 0x19, 0x00,
- 0x29, 0x65,
- 0x81, 0x00,
-
- 0xC0,
-
- #if EN_CONSUMER_MODE
- 0x05, 0x0C,
- 0x09, 0x01,
- 0xA1, 0x01,
- 0x85, HID_RPT_ID_CC_IN,
- 0x09, 0x02,
- 0xA1, 0x02,
- 0x05, 0x09,
- 0x19, 0x01,
- 0x29, 0x0A,
- 0x15, 0x01,
- 0x25, 0x0A,
- 0x75, 0x04,
- 0x95, 0x01,
- 0x81, 0x00,
- 0xC0,
-
- 0x05, 0x0C,
- 0x09, 0x86,
- 0x15, 0xFF,
- 0x25, 0x01,
- 0x75, 0x02,
- 0x95, 0x01,
- 0x81, 0x46,
- 0x09, 0xE9,
- 0x09, 0xEA,
- 0x15, 0x00,
- 0x75, 0x01,
- 0x95, 0x02,
- 0x81, 0x02,
- 0x09, 0xE2,
- 0x09, 0x30,
- 0x09, 0x83,
- 0x09, 0x81,
- 0x09, 0xB0,
- 0x09, 0xB1,
- 0x09, 0xB2,
- 0x09, 0xB3,
- 0x09, 0xB4,
- 0x09, 0xB5,
- 0x09, 0xB6,
- 0x09, 0xB7,
- 0x15, 0x01,
- 0x25, 0x0C,
- 0x75, 0x04,
- 0x95, 0x01,
- 0x81, 0x00,
- 0x09, 0x80,
- 0xA1, 0x02,
- 0x05, 0x09,
- 0x19, 0x01,
- 0x29, 0x03,
- 0x15, 0x01,
- 0x25, 0x03,
- 0x75, 0x02,
- 0x81, 0x00,
- 0xC0,
- 0x81, 0x03,
- 0xC0,
- #endif
- #if EN_VOICE_MODE
-
- 0x05, 0x0C,
- 0x09, 0x01,
- 0xA1, 0x01,
- 0x85, HID_RPT_ID_VOICE_START_IN,
- 0x15, 0x00,
- 0x26, 0xFF, 0x00,
- 0x75, 0x08,
- 0x95, 0x05,
- 0x09, 0x01,
- 0x81, 0x00,
- 0x85, HID_RPT_ID_VOICE_DATA_IN,
- 0x15, 0x00,
- 0x26, 0xFF, 0x00,
- 0x75, 0x08,
- 0x95, 0x14,
- 0x09, 0x01,
- 0x81, 0x00,
- 0xC0
- #endif
- };
- #endif
- uint16 hidReportMapLen = sizeof(hidReportMap);
- hidRptMap_t hidRptMap[HID_NUM_REPORTS];
- #if FOLLOW_TI_MAP
- static CONST gattAttrType_t hidService = { ATT_BT_UUID_SIZE, hidServUUID };
- static uint16 include = GATT_INVALID_HANDLE;
- static uint8 hidInfoProps = GATT_PROP_READ;
- static uint8 hidControlPointProps = GATT_PROP_WRITE_NO_RSP;
- static uint8 hidControlPoint;
- static uint8 hidProtocolModeProps = GATT_PROP_READ | GATT_PROP_WRITE_NO_RSP;
- uint8 hidProtocolMode = HID_PROTOCOL_MODE_REPORT;
- static uint8 hidReportMapProps = GATT_PROP_READ;
- static uint8 hidExtReportRefDesc[ATT_BT_UUID_SIZE] =
- { LO_UINT16(BATT_LEVEL_UUID), HI_UINT16(BATT_LEVEL_UUID) };
- static uint8 hidReportKeyInProps = GATT_PROP_READ | GATT_PROP_NOTIFY;
- static uint8 hidReportKeyIn;
- static gattCharCfg_t hidReportKeyInClientCharCfg[GATT_MAX_NUM_CONN];
- static uint8 hidReportRefKeyIn[HID_REPORT_REF_LEN] =
- { HID_RPT_ID_KEY_IN, HID_REPORT_TYPE_INPUT };
- static uint8 hidReportLedOutProps = GATT_PROP_READ |
- GATT_PROP_WRITE |
- GATT_PROP_WRITE_NO_RSP;
- static uint8 hidReportLedOut;
- static uint8 hidReportRefLedOut[HID_REPORT_REF_LEN] =
- { HID_RPT_ID_LED_OUT, HID_REPORT_TYPE_OUTPUT };
- static uint8 hidReportBootKeyInProps = GATT_PROP_READ | GATT_PROP_NOTIFY;
- static uint8 hidReportBootKeyIn;
- static gattCharCfg_t hidReportBootKeyInClientCharCfg[GATT_MAX_NUM_CONN];
- static uint8 hidReportBootKeyOutProps = GATT_PROP_READ |
- GATT_PROP_WRITE |
- GATT_PROP_WRITE_NO_RSP;
- static uint8 hidReportBootKeyOut;
- static uint8 hidReportCCInProps = GATT_PROP_READ | GATT_PROP_NOTIFY;
- static uint8 hidReportCCIn;
- static gattCharCfg_t hidReportCCInClientCharCfg[GATT_MAX_NUM_CONN];
- static uint8 hidReportRefCCIn[HID_REPORT_REF_LEN] =
- { HID_RPT_ID_CC_IN, HID_REPORT_TYPE_INPUT };
- #if 0
- static uint8 hidReportVoiceStartProps = GATT_PROP_READ | GATT_PROP_NOTIFY;
- static uint8 hidReportVoiceStart;
- static gattCharCfg_t hidReportVoiceStartInClientCharCfg[GATT_MAX_NUM_CONN];
- static uint8 hidReportRefVoiceStart[HID_REPORT_REF_LEN] =
- { HID_RPT_ID_VOICE_START_IN, HID_REPORT_TYPE_INPUT };
- static uint8 hidReportVoiceDataProps = GATT_PROP_READ | GATT_PROP_NOTIFY;
- static uint8 hidReportVoiceData;
- static gattCharCfg_t hidReportVoiceDataInClientCharCfg[GATT_MAX_NUM_CONN];
- static uint8 hidReportRefVoiceData[HID_REPORT_REF_LEN] =
- { HID_RPT_ID_VOICE_DATA_IN, HID_REPORT_TYPE_INPUT };
- #endif
- #else
- static CONST gattAttrType_t hidService = { ATT_BT_UUID_SIZE, hidServUUID };
- static uint16 include = GATT_INVALID_HANDLE;
- static uint8 hidInfoProps = GATT_PROP_READ;
- static uint8 hidReportMapProps = GATT_PROP_READ;
- static uint8 hidExtReportRefDesc[ATT_BT_UUID_SIZE] =
- { LO_UINT16(BATT_LEVEL_UUID), HI_UINT16(BATT_LEVEL_UUID) };
- static uint8 hidControlPointProps = GATT_PROP_WRITE_NO_RSP;
- static uint8 hidControlPoint;
- static uint8 hidProtocolModeProps = GATT_PROP_READ | GATT_PROP_WRITE_NO_RSP;
- uint8 hidProtocolMode = HID_PROTOCOL_MODE_REPORT;
- static uint8 hidReportKeyInProps = GATT_PROP_READ | GATT_PROP_NOTIFY;
- static uint8 hidReportKeyIn;
- static gattCharCfg_t hidReportKeyInClientCharCfg[GATT_MAX_NUM_CONN];
- static uint8 hidReportRefKeyIn[HID_REPORT_REF_LEN] =
- { HID_RPT_ID_KEY_IN, HID_REPORT_TYPE_INPUT };
- static uint8 hidReportLedOutProps = GATT_PROP_READ | GATT_PROP_WRITE | GATT_PROP_WRITE_NO_RSP;
- static uint8 hidReportLedOut;
- static uint8 hidReportRefLedOut[HID_REPORT_REF_LEN] =
- { HID_RPT_ID_LED_OUT, HID_REPORT_TYPE_OUTPUT };
- static uint8 hidReportBootKeyInProps = GATT_PROP_READ | GATT_PROP_NOTIFY;
- static uint8 hidReportBootKeyIn;
- static gattCharCfg_t hidReportBootKeyInClientCharCfg[GATT_MAX_NUM_CONN];
- static uint8 hidReportBootKeyOutProps = GATT_PROP_READ | GATT_PROP_WRITE | GATT_PROP_WRITE_NO_RSP;
- static uint8 hidReportBootKeyOut;
- static uint8 hidReportBootMouseInProps = GATT_PROP_READ | GATT_PROP_NOTIFY;
- static uint8 hidReportBootMouseIn;
- static gattCharCfg_t hidReportBootMouseInClientCharCfg[GATT_MAX_NUM_CONN];
- static uint8 hidReportFeatureProps = GATT_PROP_READ | GATT_PROP_WRITE;
- static uint8 hidReportFeature;
- static uint8 hidReportRefFeature[HID_REPORT_REF_LEN] =
- { HID_RPT_ID_FEATURE, HID_REPORT_TYPE_FEATURE };
- #if EN_VOICE_MODE
- static uint8 hidReportVoiceStartProps = GATT_PROP_READ | GATT_PROP_NOTIFY;
- static uint8 hidReportVoiceStart;
- static gattCharCfg_t *hidReportVoiceStartInClientCharCfg;
- static uint8 hidReportRefVoiceStart[HID_REPORT_REF_LEN] =
- { HID_RPT_ID_VOICE_START_IN, HID_REPORT_TYPE_INPUT };
- static uint8 hidReportVoiceDataProps = GATT_PROP_READ | GATT_PROP_NOTIFY;
- static uint8 hidReportVoiceData;
- static gattCharCfg_t *hidReportVoiceDataInClientCharCfg;
- static uint8 hidReportRefVoiceData[HID_REPORT_REF_LEN] =
- { HID_RPT_ID_VOICE_DATA_IN, HID_REPORT_TYPE_INPUT };
- #endif
- #if EN_MOUSE_REPORT
- static uint8 hidReportRefMouseIn[HID_REPORT_REF_LEN] =
- { HID_RPT_ID_MOUSE_IN, HID_REPORT_TYPE_INPUT };
- static uint8 hidReportMouseInProps = GATT_PROP_READ | GATT_PROP_NOTIFY;
- static uint8 hidReportMouseIn;
- static gattCharCfg_t hidReportMouseInClientCharCfg[GATT_MAX_NUM_CONN];
- #endif
- #if EN_CONSUMER_MODE
- static uint8 hidReportRefCCIn[HID_REPORT_REF_LEN] =
- { HID_RPT_ID_CC_IN, HID_REPORT_TYPE_INPUT };
-
- static uint8 hidReportCCInProps = GATT_PROP_READ | GATT_PROP_NOTIFY;
- static uint8 hidReportCCIn;
- static gattCharCfg_t hidReportCCInClientCharCfg[GATT_MAX_NUM_CONN];
- #endif
- #endif
- #if FOLLOW_TI_MAP
- static gattAttribute_t hidAttrTbl[] =
- {
-
- {
- { ATT_BT_UUID_SIZE, primaryServiceUUID },
- GATT_PERMIT_READ,
- 0,
- (uint8 *) &hidService
- },
-
- {
- { ATT_BT_UUID_SIZE, includeUUID },
- GATT_PERMIT_READ,
- 0,
- (uint8 *)&include
- },
-
- {
- { ATT_BT_UUID_SIZE, characterUUID },
- GATT_PERMIT_READ,
- 0,
- &hidInfoProps
- },
-
- {
- { ATT_BT_UUID_SIZE, hidInfoUUID },
- GATT_PERMIT_ENCRYPT_READ,
- 0,
- (uint8 *) hidInfo
- },
-
- {
- { ATT_BT_UUID_SIZE, characterUUID },
- GATT_PERMIT_READ,
- 0,
- &hidControlPointProps
- },
-
- {
- { ATT_BT_UUID_SIZE, hidControlPointUUID },
- GATT_PERMIT_ENCRYPT_WRITE,
- 0,
- &hidControlPoint
- },
-
- {
- { ATT_BT_UUID_SIZE, characterUUID },
- GATT_PERMIT_READ,
- 0,
- &hidProtocolModeProps
- },
-
- {
- { ATT_BT_UUID_SIZE, hidProtocolModeUUID },
- GATT_PERMIT_ENCRYPT_READ | GATT_PERMIT_ENCRYPT_WRITE,
- 0,
- &hidProtocolMode
- },
-
- {
- { ATT_BT_UUID_SIZE, characterUUID },
- GATT_PERMIT_READ,
- 0,
- &hidReportMapProps
- },
-
- {
- { ATT_BT_UUID_SIZE, hidReportMapUUID },
- GATT_PERMIT_ENCRYPT_READ,
- 0,
- (uint8 *) hidReportMap
- },
-
- {
- { ATT_BT_UUID_SIZE, extReportRefUUID },
- GATT_PERMIT_READ,
- 0,
- hidExtReportRefDesc
- },
-
- {
- { ATT_BT_UUID_SIZE, characterUUID },
- GATT_PERMIT_READ,
- 0,
- &hidReportKeyInProps
- },
-
- {
- { ATT_BT_UUID_SIZE, hidReportUUID },
- GATT_PERMIT_ENCRYPT_READ,
- 0,
- &hidReportKeyIn
- },
-
- {
- { ATT_BT_UUID_SIZE, clientCharCfgUUID },
- GATT_PERMIT_READ | GATT_PERMIT_ENCRYPT_WRITE,
- 0,
- (uint8 *) &hidReportKeyInClientCharCfg
- },
-
- {
- { ATT_BT_UUID_SIZE, reportRefUUID },
- GATT_PERMIT_READ,
- 0,
- hidReportRefKeyIn
- },
-
- {
- { ATT_BT_UUID_SIZE, characterUUID },
- GATT_PERMIT_READ,
- 0,
- &hidReportLedOutProps
- },
-
- {
- { ATT_BT_UUID_SIZE, hidReportUUID },
- GATT_PERMIT_ENCRYPT_READ | GATT_PERMIT_ENCRYPT_WRITE,
- 0,
- &hidReportLedOut
- },
-
- {
- { ATT_BT_UUID_SIZE, reportRefUUID },
- GATT_PERMIT_READ,
- 0,
- hidReportRefLedOut
- },
-
- {
- { ATT_BT_UUID_SIZE, characterUUID },
- GATT_PERMIT_READ,
- 0,
- &hidReportBootKeyInProps
- },
-
- {
- { ATT_BT_UUID_SIZE, hidBootKeyInputUUID },
- GATT_PERMIT_ENCRYPT_READ,
- 0,
- &hidReportBootKeyIn
- },
-
- {
- { ATT_BT_UUID_SIZE, clientCharCfgUUID },
- GATT_PERMIT_READ | GATT_PERMIT_ENCRYPT_WRITE,
- 0,
- (uint8 *) &hidReportBootKeyInClientCharCfg
- },
-
- {
- { ATT_BT_UUID_SIZE, characterUUID },
- GATT_PERMIT_READ,
- 0,
- &hidReportBootKeyOutProps
- },
-
- {
- { ATT_BT_UUID_SIZE, hidBootKeyOutputUUID },
- GATT_PERMIT_ENCRYPT_READ | GATT_PERMIT_ENCRYPT_WRITE,
- 0,
- &hidReportBootKeyOut
- },
-
- {
- { ATT_BT_UUID_SIZE, characterUUID },
- GATT_PERMIT_READ,
- 0,
- &hidReportCCInProps
- },
-
- {
- { ATT_BT_UUID_SIZE, hidReportUUID },
- GATT_PERMIT_ENCRYPT_READ,
- 0,
- &hidReportCCIn
- },
-
- {
- { ATT_BT_UUID_SIZE, clientCharCfgUUID },
- GATT_PERMIT_READ | GATT_PERMIT_ENCRYPT_WRITE,
- 0,
- (uint8 *) &hidReportCCInClientCharCfg
- },
-
- {
- { ATT_BT_UUID_SIZE, reportRefUUID },
- GATT_PERMIT_READ,
- 0,
- hidReportRefCCIn
- },
- #if 0
-
- {
- { ATT_BT_UUID_SIZE, characterUUID },
- GATT_PERMIT_READ,
- 0,
- &hidReportVoiceStartProps
- },
-
- {
- { ATT_BT_UUID_SIZE, hidReportUUID },
- GATT_PERMIT_ENCRYPT_READ,
- 0,
- &hidReportVoiceStart
- },
-
- {
- { ATT_BT_UUID_SIZE, clientCharCfgUUID },
- GATT_PERMIT_READ | GATT_PERMIT_ENCRYPT_WRITE,
- 0,
- (uint8 *) &hidReportVoiceStartInClientCharCfg
- },
-
- {
- { ATT_BT_UUID_SIZE, reportRefUUID },
- GATT_PERMIT_READ,
- 0,
- hidReportRefVoiceStart
- },
-
- {
- { ATT_BT_UUID_SIZE, characterUUID },
- GATT_PERMIT_READ,
- 0,
- &hidReportVoiceDataProps
- },
-
- {
- { ATT_BT_UUID_SIZE, hidReportUUID },
- GATT_PERMIT_ENCRYPT_READ,
- 0,
- &hidReportVoiceData
- },
-
- {
- { ATT_BT_UUID_SIZE, clientCharCfgUUID },
- GATT_PERMIT_READ | GATT_PERMIT_ENCRYPT_WRITE,
- 0,
- (uint8 *) &hidReportVoiceDataInClientCharCfg
- },
-
- {
- { ATT_BT_UUID_SIZE, reportRefUUID },
- GATT_PERMIT_READ,
- 0,
- hidReportRefVoiceData
- },
- #endif
- };
- #else
- static gattAttribute_t hidAttrTbl[] =
- {
-
- {
- { ATT_BT_UUID_SIZE, primaryServiceUUID },
- GATT_PERMIT_READ,
- 0,
- (uint8 *) &hidService
- },
-
- {
- { ATT_BT_UUID_SIZE, includeUUID },
- GATT_PERMIT_READ,
- 0,
- (uint8 *)&include
- },
-
- {
- { ATT_BT_UUID_SIZE, characterUUID },
- GATT_PERMIT_READ,
- 0,
- &hidInfoProps
- },
-
- {
- { ATT_BT_UUID_SIZE, hidInfoUUID },
- GATT_PERMIT_ENCRYPT_READ,
- 0,
- (uint8 *) hidInfo
- },
-
- {
- { ATT_BT_UUID_SIZE, characterUUID },
- GATT_PERMIT_READ,
- 0,
- &hidControlPointProps
- },
-
- {
- { ATT_BT_UUID_SIZE, hidControlPointUUID },
- GATT_PERMIT_ENCRYPT_WRITE,
- 0,
- &hidControlPoint
- },
-
- {
- { ATT_BT_UUID_SIZE, characterUUID },
- GATT_PERMIT_READ,
- 0,
- &hidProtocolModeProps
- },
-
- {
- { ATT_BT_UUID_SIZE, hidProtocolModeUUID },
- GATT_PERMIT_ENCRYPT_READ | GATT_PERMIT_ENCRYPT_WRITE,
- 0,
- &hidProtocolMode
- },
-
- {
- { ATT_BT_UUID_SIZE, characterUUID },
- GATT_PERMIT_READ,
- 0,
- &hidReportMapProps
- },
-
- {
- { ATT_BT_UUID_SIZE, hidReportMapUUID },
- GATT_PERMIT_ENCRYPT_READ,
- 0,
- (uint8 *) hidReportMap
- },
-
- {
- { ATT_BT_UUID_SIZE, extReportRefUUID },
- GATT_PERMIT_READ,
- 0,
- hidExtReportRefDesc
- },
- #if EN_MOUSE_REPORT
- {
- { ATT_BT_UUID_SIZE, characterUUID },
- GATT_PERMIT_READ,
- 0,
- &hidReportMouseInProps
- },
-
- {
- { ATT_BT_UUID_SIZE, hidReportUUID },
- GATT_PERMIT_ENCRYPT_READ,
- 0,
- &hidReportMouseIn
- },
-
- {
- { ATT_BT_UUID_SIZE, clientCharCfgUUID },
- GATT_PERMIT_READ | GATT_PERMIT_ENCRYPT_WRITE,
- 0,
- (uint8 *) &hidReportMouseInClientCharCfg
- },
-
- {
- { ATT_BT_UUID_SIZE, reportRefUUID },
- GATT_PERMIT_READ,
- 0,
- hidReportRefMouseIn
- },
- #endif
-
-
- {
- { ATT_BT_UUID_SIZE, characterUUID },
- GATT_PERMIT_READ,
- 0,
- &hidReportKeyInProps
- },
-
- {
- { ATT_BT_UUID_SIZE, hidReportUUID },
- GATT_PERMIT_ENCRYPT_READ,
- 0,
- &hidReportKeyIn
- },
-
- {
- { ATT_BT_UUID_SIZE, clientCharCfgUUID },
- GATT_PERMIT_READ | GATT_PERMIT_ENCRYPT_WRITE,
- 0,
- (uint8 *) &hidReportKeyInClientCharCfg
- },
-
- {
- { ATT_BT_UUID_SIZE, reportRefUUID },
- GATT_PERMIT_READ,
- 0,
- hidReportRefKeyIn
- },
-
- {
- { ATT_BT_UUID_SIZE, characterUUID },
- GATT_PERMIT_READ,
- 0,
- &hidReportLedOutProps
- },
-
- {
- { ATT_BT_UUID_SIZE, hidReportUUID },
- GATT_PERMIT_ENCRYPT_READ | GATT_PERMIT_ENCRYPT_WRITE,
- 0,
- &hidReportLedOut
- },
-
- {
- { ATT_BT_UUID_SIZE, reportRefUUID },
- GATT_PERMIT_READ,
- 0,
- hidReportRefLedOut
- },
-
- {
- { ATT_BT_UUID_SIZE, characterUUID },
- GATT_PERMIT_READ,
- 0,
- &hidReportBootKeyInProps
- },
-
- {
- { ATT_BT_UUID_SIZE, hidBootKeyInputUUID },
- GATT_PERMIT_ENCRYPT_READ,
- 0,
- &hidReportBootKeyIn
- },
-
- {
- { ATT_BT_UUID_SIZE, clientCharCfgUUID },
- GATT_PERMIT_READ | GATT_PERMIT_ENCRYPT_WRITE,
- 0,
- (uint8 *) &hidReportBootKeyInClientCharCfg
- },
-
- {
- { ATT_BT_UUID_SIZE, characterUUID },
- GATT_PERMIT_READ,
- 0,
- &hidReportBootKeyOutProps
- },
-
- {
- { ATT_BT_UUID_SIZE, hidBootKeyOutputUUID },
- GATT_PERMIT_ENCRYPT_READ | GATT_PERMIT_ENCRYPT_WRITE,
- 0,
- &hidReportBootKeyOut
- },
- #if EN_CONSUMER_MODE
-
- {
- { ATT_BT_UUID_SIZE, characterUUID },
- GATT_PERMIT_READ,
- 0,
- &hidReportCCInProps
- },
-
-
- {
- { ATT_BT_UUID_SIZE, hidReportUUID },
- GATT_PERMIT_ENCRYPT_READ,
- 0,
- &hidReportCCIn
- },
-
-
- {
- { ATT_BT_UUID_SIZE, clientCharCfgUUID },
- GATT_PERMIT_READ | GATT_PERMIT_ENCRYPT_WRITE,
- 0,
- (uint8 *) &hidReportCCInClientCharCfg
- },
-
-
- {
- { ATT_BT_UUID_SIZE, reportRefUUID },
- GATT_PERMIT_READ,
- 0,
- hidReportRefCCIn
- },
- #endif
-
- {
- { ATT_BT_UUID_SIZE, characterUUID },
- GATT_PERMIT_READ,
- 0,
- &hidReportBootMouseInProps
- },
-
- {
- { ATT_BT_UUID_SIZE, hidBootMouseInputUUID },
- GATT_PERMIT_ENCRYPT_READ,
- 0,
- &hidReportBootMouseIn
- },
-
- {
- { ATT_BT_UUID_SIZE, clientCharCfgUUID },
- GATT_PERMIT_READ | GATT_PERMIT_ENCRYPT_WRITE,
- 0,
- (uint8 *) &hidReportBootMouseInClientCharCfg
- },
-
- {
- { ATT_BT_UUID_SIZE, characterUUID },
- GATT_PERMIT_READ,
- 0,
- &hidReportFeatureProps
- },
-
- {
- { ATT_BT_UUID_SIZE, hidReportUUID},
- GATT_PERMIT_ENCRYPT_READ | GATT_PERMIT_ENCRYPT_WRITE,
- 0,
- &hidReportFeature
- },
-
- {
- { ATT_BT_UUID_SIZE, reportRefUUID },
- GATT_PERMIT_READ,
- 0,
- hidReportRefFeature
- },
- #if EN_VOICE_MODE
-
- {
- { ATT_BT_UUID_SIZE, characterUUID },
- GATT_PERMIT_READ,
- 0,
- &hidReportVoiceStartProps
- },
-
- {
- { ATT_BT_UUID_SIZE, hidReportUUID },
- GATT_PERMIT_ENCRYPT_READ,
- 0,
- &hidReportVoiceStart
- },
-
- {
- { ATT_BT_UUID_SIZE, clientCharCfgUUID },
- GATT_PERMIT_READ | GATT_PERMIT_ENCRYPT_WRITE,
- 0,
- (uint8 *) &hidReportVoiceStartInClientCharCfg
- },
-
- {
- { ATT_BT_UUID_SIZE, reportRefUUID },
- GATT_PERMIT_READ,
- 0,
- hidReportRefVoiceStart
- },
-
- {
- { ATT_BT_UUID_SIZE, characterUUID },
- GATT_PERMIT_READ,
- 0,
- &hidReportVoiceDataProps
- },
-
- {
- { ATT_BT_UUID_SIZE, hidReportUUID },
- GATT_PERMIT_ENCRYPT_READ,
- 0,
- &hidReportVoiceData
- },
-
- {
- { ATT_BT_UUID_SIZE, clientCharCfgUUID },
- GATT_PERMIT_READ | GATT_PERMIT_ENCRYPT_WRITE,
- 0,
- (uint8 *) &hidReportVoiceDataInClientCharCfg
- },
-
- {
- { ATT_BT_UUID_SIZE, reportRefUUID },
- GATT_PERMIT_READ,
- 0,
- hidReportRefVoiceData
- },
- #endif
- };
- #endif
- CONST gattServiceCBs_t hidKbdCBs =
- {
- HidDev_ReadAttrCB,
- HidDev_WriteAttrCB,
- NULL
- };
- #if FOLLOW_TI_MAP
- bStatus_t HidKbd_AddService( void )
- {
- uint8 status = SUCCESS;
-
- GATTServApp_InitCharCfg( INVALID_CONNHANDLE, hidReportKeyInClientCharCfg );
- GATTServApp_InitCharCfg( INVALID_CONNHANDLE, hidReportBootKeyInClientCharCfg );
- GATTServApp_InitCharCfg(INVALID_CONNHANDLE, hidReportCCInClientCharCfg);
- #if 0
- GATTServApp_InitCharCfg(INVALID_CONNHANDLE, hidReportVoiceStartInClientCharCfg);
- GATTServApp_InitCharCfg(INVALID_CONNHANDLE, hidReportVoiceDataInClientCharCfg);
- #endif
-
- status = GATTServApp_RegisterService( hidAttrTbl, GATT_NUM_ATTRS( hidAttrTbl ), &hidKbdCBs );
-
- Batt_GetParameter( BATT_PARAM_SERVICE_HANDLE,
- &GATT_INCLUDED_HANDLE( hidAttrTbl, HID_INCLUDED_SERVICE_IDX ) );
-
-
-
- hidRptMap[0].id = hidReportRefKeyIn[0];
- hidRptMap[0].type = hidReportRefKeyIn[1];
- hidRptMap[0].handle = hidAttrTbl[HID_REPORT_KEY_IN_IDX].handle;
- hidRptMap[0].cccdHandle = hidAttrTbl[HID_REPORT_KEY_IN_CCCD_IDX].handle;
- hidRptMap[0].mode = HID_PROTOCOL_MODE_REPORT;
-
- hidRptMap[1].id = hidReportRefLedOut[0];
- hidRptMap[1].type = hidReportRefLedOut[1];
- hidRptMap[1].handle = hidAttrTbl[HID_REPORT_LED_OUT_IDX].handle;
- hidRptMap[1].cccdHandle = 0;
- hidRptMap[1].mode = HID_PROTOCOL_MODE_REPORT;
-
-
- hidRptMap[2].id = hidReportRefKeyIn[0];
- hidRptMap[2].type = hidReportRefKeyIn[1];
- hidRptMap[2].handle = hidAttrTbl[HID_BOOT_KEY_IN_IDX].handle;
- hidRptMap[2].cccdHandle = hidAttrTbl[HID_BOOT_KEY_IN_CCCD_IDX].handle;
- hidRptMap[2].mode = HID_PROTOCOL_MODE_BOOT;
-
-
- hidRptMap[3].id = hidReportRefLedOut[0];
- hidRptMap[3].type = hidReportRefLedOut[1];
- hidRptMap[3].handle = hidAttrTbl[HID_BOOT_KEY_OUT_IDX].handle;
- hidRptMap[3].cccdHandle = 0;
- hidRptMap[3].mode = HID_PROTOCOL_MODE_BOOT;
-
- hidRptMap[4].id = hidReportRefCCIn[0];
- hidRptMap[4].type = hidReportRefCCIn[1];
- hidRptMap[4].handle = hidAttrTbl[HID_REPORT_CC_IN_IDX].handle;
- hidRptMap[4].cccdHandle = hidAttrTbl[HID_REPORT_CC_IN_CCCD_IDX].handle;
- hidRptMap[4].mode = HID_PROTOCOL_MODE_REPORT;
-
- #if 0
-
- hidRptMap[5].id = hidReportRefVoiceStart[0];
- hidRptMap[5].type = hidReportRefVoiceStart[1];
- hidRptMap[5].handle = hidAttrTbl[HID_VOICE_START_IN_IDX].handle;
- hidRptMap[5].cccdHandle = hidAttrTbl[HID_VOICE_START_IN_CCCD_IDX].handle;
- hidRptMap[5].mode = HID_PROTOCOL_MODE_REPORT;
-
- hidRptMap[6].id = hidReportRefVoiceData[0];
- hidRptMap[6].type = hidReportRefVoiceData[1];
- hidRptMap[6].handle = hidAttrTbl[HID_VOICE_DATA_IN_IDX].handle;
- hidRptMap[6].cccdHandle = hidAttrTbl[HID_VOICE_DATA_IN_CCCD_IDX].handle;
- hidRptMap[6].mode = HID_PROTOCOL_MODE_REPORT;
- #endif
-
-
- VOID Batt_GetParameter( BATT_PARAM_BATT_LEVEL_IN_REPORT, &(hidRptMap[2]) );
-
- HidDev_RegisterReports( HID_NUM_REPORTS, hidRptMap );
- return ( status );
- }
- #else
- bStatus_t HidKbd_AddService( void )
- {
- uint8 status = SUCCESS;
-
- GATTServApp_InitCharCfg( INVALID_CONNHANDLE, hidReportKeyInClientCharCfg );
- GATTServApp_InitCharCfg( INVALID_CONNHANDLE, hidReportBootKeyInClientCharCfg );
- GATTServApp_InitCharCfg( INVALID_CONNHANDLE, hidReportBootMouseInClientCharCfg );
-
- status = GATTServApp_RegisterService( hidAttrTbl, GATT_NUM_ATTRS( hidAttrTbl ), &hidKbdCBs );
-
- Batt_GetParameter( BATT_PARAM_SERVICE_HANDLE,
- &GATT_INCLUDED_HANDLE( hidAttrTbl, HID_INCLUDED_SERVICE_IDX ) );
-
-
-
- hidRptMap[0].id = hidReportRefKeyIn[0];
- hidRptMap[0].type = hidReportRefKeyIn[1];
- hidRptMap[0].handle = hidAttrTbl[HID_REPORT_KEY_IN_IDX].handle;
- hidRptMap[0].cccdHandle = hidAttrTbl[HID_REPORT_KEY_IN_CCCD_IDX].handle;
- hidRptMap[0].mode = HID_PROTOCOL_MODE_REPORT;
-
- hidRptMap[1].id = hidReportRefLedOut[0];
- hidRptMap[1].type = hidReportRefLedOut[1];
- hidRptMap[1].handle = hidAttrTbl[HID_REPORT_LED_OUT_IDX].handle;
- hidRptMap[1].cccdHandle = 0;
- hidRptMap[1].mode = HID_PROTOCOL_MODE_REPORT;
-
-
- hidRptMap[2].id = hidReportRefKeyIn[0];
- hidRptMap[2].type = hidReportRefKeyIn[1];
- hidRptMap[2].handle = hidAttrTbl[HID_BOOT_KEY_IN_IDX].handle;
- hidRptMap[2].cccdHandle = hidAttrTbl[HID_BOOT_KEY_IN_CCCD_IDX].handle;
- hidRptMap[2].mode = HID_PROTOCOL_MODE_BOOT;
-
-
- hidRptMap[3].id = hidReportRefLedOut[0];
- hidRptMap[3].type = hidReportRefLedOut[1];
- hidRptMap[3].handle = hidAttrTbl[HID_BOOT_KEY_OUT_IDX].handle;
- hidRptMap[3].cccdHandle = 0;
- hidRptMap[3].mode = HID_PROTOCOL_MODE_BOOT;
-
- hidRptMap[4].id = HID_RPT_ID_MOUSE_IN;
- hidRptMap[4].type = HID_REPORT_TYPE_INPUT;
- hidRptMap[4].handle = hidAttrTbl[HID_BOOT_MOUSE_IN_IDX].handle;
- hidRptMap[4].cccdHandle = hidAttrTbl[HID_BOOT_MOUSE_IN_CCCD_IDX].handle;
- hidRptMap[4].mode = HID_PROTOCOL_MODE_BOOT;
-
- hidRptMap[5].id = hidReportRefFeature[0];
- hidRptMap[5].type = hidReportRefFeature[1];
- hidRptMap[5].handle = hidAttrTbl[HID_FEATURE_IDX].handle;
- hidRptMap[5].cccdHandle = 0;
- hidRptMap[5].mode = HID_PROTOCOL_MODE_REPORT;
-
- VOID Batt_GetParameter( BATT_PARAM_BATT_LEVEL_IN_REPORT, &(hidRptMap[6]) );
- #if EN_VOICE_MODE
-
- hidRptMap[7].id = hidReportRefVoiceStart[0];
- hidRptMap[7].type = hidReportRefVoiceStart[1];
- hidRptMap[7].handle = hidAttrTbl[HID_VOICE_START_IN_IDX].handle;
- hidRptMap[7].cccdHandle = hidAttrTbl[HID_VOICE_START_IN_CCCD_IDX].handle;
- hidRptMap[7].mode = HID_PROTOCOL_MODE_REPORT;
-
- hidRptMap[8].id = hidReportRefVoiceData[0];
- hidRptMap[8].type = hidReportRefVoiceData[1];
- hidRptMap[8].handle = hidAttrTbl[HID_VOICE_DATA_IN_IDX].handle;
- hidRptMap[8].cccdHandle = hidAttrTbl[HID_VOICE_DATA_IN_CCCD_IDX].handle;
- hidRptMap[8].mode = HID_PROTOCOL_MODE_REPORT;
- #endif
- #if EN_MOUSE_REPORT
-
- hidRptMap[9].id = hidReportRefMouseIn[0];
- hidRptMap[9].type = hidReportRefMouseIn[1];
- hidRptMap[9].handle = hidAttrTbl[HID_REPORT_MOUSE_IN_IDX].handle;
- hidRptMap[9].cccdHandle = hidAttrTbl[HID_REPORT_MOUSE_IN_CCCD_IDX].handle;
- hidRptMap[9].mode = HID_PROTOCOL_MODE_REPORT;
- #endif
- #if EN_CONSUMER_MODE
-
- hidRptMap[10].id = hidReportRefCCIn[0];
- hidRptMap[10].type = hidReportRefCCIn[1];
- hidRptMap[10].handle = hidAttrTbl[HID_REPORT_CC_IN_IDX].handle;
- hidRptMap[10].cccdHandle = hidAttrTbl[HID_REPORT_CC_IN_CCCD_IDX].handle;
- hidRptMap[10].mode = HID_PROTOCOL_MODE_REPORT;
- #endif
-
- HidDev_RegisterReports( HID_NUM_REPORTS, hidRptMap );
- return ( status );
- }
- #endif
- uint8 HidKbd_SetParameter( uint8 id, uint8 type, uint16 uuid, uint8 len, void *pValue )
- {
- bStatus_t ret = SUCCESS;
- switch ( uuid )
- {
- case REPORT_UUID:
- if ( type == HID_REPORT_TYPE_OUTPUT )
- {
- if ( len == 1 )
- {
- hidReportLedOut = *((uint8 *)pValue);
- }
- else
- {
- ret = ATT_ERR_INVALID_VALUE_SIZE;
- }
- }
- else if ( type == HID_REPORT_TYPE_FEATURE )
- {
- if ( len == 1 )
- {
-
- }
- else
- {
- ret = ATT_ERR_INVALID_VALUE_SIZE;
- }
- }
- else
- {
- ret = ATT_ERR_ATTR_NOT_FOUND;
- }
- break;
- case BOOT_KEY_OUTPUT_UUID:
- if ( len == 1 )
- {
- hidReportBootKeyOut = *((uint8 *)pValue);
- }
- else
- {
- ret = ATT_ERR_INVALID_VALUE_SIZE;
- }
- break;
- default:
-
- break;
- }
- return ( ret );
- }
- uint8 HidKbd_GetParameter( uint8 id, uint8 type, uint16 uuid, uint8 *pLen, void *pValue )
- {
- switch ( uuid )
- {
- case REPORT_UUID:
- if ( type == HID_REPORT_TYPE_OUTPUT )
- {
- *((uint8 *)pValue) = hidReportLedOut;
- *pLen = 1;
- }
- else if ( type == HID_REPORT_TYPE_FEATURE )
- {
-
-
- }
- else
- {
- *pLen = 0;
- }
- break;
- case BOOT_KEY_OUTPUT_UUID:
- *((uint8 *)pValue) = hidReportBootKeyOut;
- *pLen = 1;
- break;
- default:
- *pLen = 0;
- break;
- }
- return ( SUCCESS );
- }
|