Example: quiz answers

Implementing Eddystone™ Bluetooth® Smart Beacons Using …

1 SWRA491A September2015 RevisedOctober2016 SubmitDocumentationFeedbackCopyright 2015 2016,TexasInstrumentsIncorporatedImpleme ntingEddystoneBluetoothSmartBeaconsUsing the TI BLE-StackApplicationReportSWRA491A September2015 RevisedOctober2016 ImplementingEddystone bluetooth SmartBeaconsUsingthe TI BLE-Stack ChesterKimABSTRACTT hisapplicationnotedescribesthe basicconceptof Eddystone Beacon,howconnectablebeaconapplicationsc an be implementedon top of the existingsampleapplicationSimpleBLEP eripheral,and howthe compatibilityto Eddystonespecificationcab be ,callbacks,and usagesof hardwaredriversfor obtaininginformationto populatethe of of ,SimpleLinkare trademarksof a registeredtrademarkof a trademarkof Google, othertrademarksare the propertyof September2015 RevisedOctober2016 SubmitDocumentationFeedbackCopyright 2015 2016,TexasInstrumentsIncorporatedImpleme ntingEddystoneBluetoothSmartBeaconsUsing the TI BLE-Stack1 IntroductionAs describedin theBluetooth low energyBeaconsApplicationNote(SWRA475), a bluetooth lowenergy(BLE)beaconis a devicebroadcastinga non-connectableadvertisingpacketcarrying smallpiecesof informationto the timingand the informationconveyedwithinthe packet,beaconscan enablea varietyof use cases,includingbut not limit

Advertising UID Frame Advertising URL Frame Config Mode Advertising Advertising TLM Frame Connected Start RIGHT btn press RIGHT btn press LEFT btn press

Tags:

  Bluetooth

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Implementing Eddystone™ Bluetooth® Smart Beacons Using …

1 1 SWRA491A September2015 RevisedOctober2016 SubmitDocumentationFeedbackCopyright 2015 2016,TexasInstrumentsIncorporatedImpleme ntingEddystoneBluetoothSmartBeaconsUsing the TI BLE-StackApplicationReportSWRA491A September2015 RevisedOctober2016 ImplementingEddystone bluetooth SmartBeaconsUsingthe TI BLE-Stack ChesterKimABSTRACTT hisapplicationnotedescribesthe basicconceptof Eddystone Beacon,howconnectablebeaconapplicationsc an be implementedon top of the existingsampleapplicationSimpleBLEP eripheral,and howthe compatibilityto Eddystonespecificationcab be ,callbacks,and usagesof hardwaredriversfor obtaininginformationto populatethe of of ,SimpleLinkare trademarksof a registeredtrademarkof a trademarkof Google, othertrademarksare the propertyof September2015 RevisedOctober2016 SubmitDocumentationFeedbackCopyright 2015 2016,TexasInstrumentsIncorporatedImpleme ntingEddystoneBluetoothSmartBeaconsUsing the TI BLE-Stack1 IntroductionAs describedin theBluetooth low energyBeaconsApplicationNote(SWRA475), a bluetooth lowenergy(BLE)

2 Beaconis a devicebroadcastinga non-connectableadvertisingpacketcarrying smallpiecesof informationto the timingand the informationconveyedwithinthe packet,beaconscan enablea varietyof use cases,includingbut not limitedto proximityawareness,synchronization,ident ification,or just protocolor formatfor how the beaconis implementedin a example,Applehas definedthe iBeaconprotocol,availableunderan MFi license,for usewith iOS is an openbeaconprotocolspecificationfromGoogl eaimedat improvingproximity-basedexperiences,with supportfor bothAndroidand iOS specifyingvariousbeaconpayloadformats,de finedas frames-types,as well as acorrespondingset of APIsusedto accessthesepayloadsfromthe smartdevice(suchas an Androidsmartphone).This applicationnotedescribeshow to implementan exampleEddystonebeacondeviceusingthe TI BLE-Stack the SimpleLink lowerpowerconsumptionand wideoperatingvoltagecapabilitymakethe CC2640an idealplatformfor , by definition,broadcast-onlydevices,the conceptof a connectablebeaconwill beaconentera connectablestate(technically,switchingfr omthe GAPbroadcasterto the peripheralrole)

3 Is desirablefor the purposesof provisioningand updatingthe metadataof Eddystoneprotocoldefinesa modethat allowsthe beacondatato be updatedby projectfiles and the sourcecodefiles createdor modifiedfor EddystoneBeacondeviceimplementationare availableas a GitHubrepository,whichcan be foundon the TI BLE energyCCSCodeComposerStudioIDIdentifierG APG eneralAccessProfileMCUM icrocontrollerOADO verthe Air DownloadSDKS oftwareDevelopmentKitTI-RTOST exasInstrumentsRealTimeOperatingSystemTL MT elemetryTXTransmissionUIDU niqueIdentityURLU niformResourceLocator3 ObjectiveThis applicationshowswhatmustbe implementedon top of the existingSimpleBLEP eripheralsampleapplicationto makea Prerequisites3 SWRA491A September2015 RevisedOctober2016 SubmitDocumentationFeedbackCopyright 2015 2016,TexasInstrumentsIncorporatedImpleme ntingEddystoneBluetoothSmartBeaconsUsing the TI BLE-Stack4 ProjectOverviewand PrerequisitesPriorto followingthe examplesdescribedin this applicationnote,the designershouldhavea detailedunderstandingof the TI BLE-StackSDKas describedin the SW Developer s Guide(SWRU393), theBluetoothlow energyBeaconsapplicationnote(SWRA475)

4 , and the GoogleEddystoneprotocolspecification,whi chcan be foundat sampleapplicationSimpleEddystoneBeaconre quiresTI IDEscan be usedto buildthe SimpleEddystoneBeaconprojectrunson the optionalsmartphoneand test applicationcan be usedto validatethe TI GitHubrepositoryble_examplesincludesthe minimumnumberof files necessaryto buildtheprojectwhenthey are put on top of the repositoryconsistsofprojectand workspacefiles for IAR/CCS,as well , whichare for the application, , installthe SimpleEddystoneBeaconproject,copythe followingfoldersinto the appropriatedirectoriesin the SDK: ble_examples/examples/cc2650lp/simple_ed dystone ble_examples/src/examples/simple_eddysto ne/cc26xx ble_examples/src/profiles/EddystoneURLCf g5 Designand Eddystoneprotocoldefinesthreeframe-typef ormats(referredto as frames ), whichare transmittedby the beacondeviceas describedin EddystoneFrameFormatsFrame-typeDescripti onUIDU niqueidentifierthat can identifya URL,suchas , that canbe launchedby the ,suchas batteryvoltageand temperatureof the describedin moredetailin the advertisingpacket,up to the maximum31-bytepayloaddefinedby the EddystoneBeacondefinestwo modesof operation.

5 Regularadvertisingmodeand an relatedby five regularadvertisingmode,the beaconoperatesas a traditionalbroadcastersendingnon-connect ableadvertisementsconsistingof UID,URL,or URLconfigurationmode,the beacontransmitsconnectableadvertisements to allowa clientto connect,and if authorized,updatethe URLcontentandthe systemparametersthroughthe operatingstatetransitionsfor thesemodesof operationare depictedin Figure1, alongwith thecorrespondingactionsusedto transitionstatesin the a greycirclerepresentURLconfigurationmode, whilethe Eddystoneprotocoldoesnot specifythe type,when,or how oftena particularframeis transmitted,orthe actionsthat triggera ,for example,transmitonly URLframes,or a combinationof all UID FrameAdvertising URL FrameConfig Mode AdvertisingAdvertising TLM FrameConnectedStartRIGHT btn pressRIGHT btn pressLEFT btn pressLEFT btn pressConnection EstablishedConnection TerminatedPacket Cnt % 10 == 0 Packet Cnt % 10 == 0 Return to last stateReturn to last stateDesignand September2015 RevisedOctober2016 SubmitDocumentationFeedbackCopyright 2015 2016,TexasInstrumentsIncorporatedImpleme ntingEddystoneBluetoothSmartBeaconsUsing the TI BLE-StackFigure1.

6 SimpleEddystoneBeaconOperationModeTransi tionsIn this design,the beacondevicesendseitherUID framesor URLframesregularly,and TLMframesintermittently,whilein statetransitionsbetweenUID and URLare toggledby a practicalreasons,TLMframesare expectedto be observedless frequentlythanUID or URLframes,so in this design,they are sent only every10thadvertiseof UID or be enteredby enteringthe configmodeadvertisingstatein this istriggeredby a be causedby a LEFT buttonpress,orany type of terminationof the ,the centralterminatesthe connectionwhenthebeaconis finishedupdating,to let the use a buttonpressto triggersomeof the transitions,the key eventhandlermustbe implementedslightlydifferentlyby this implementation, usedfor the any case,SimpleEddystoneBeacon_keyChangeHand ler()is registeredas the callbackand eventuallythe key eventSEB_KEY_CHANGE_EVTis handledbySimpleEddystoneBeacon_handleKey s().

7 For the CC2650 LaunchPad,all RIGHTbtn pressescorrespondto BTN-2,and all LEFT buttonpressescorrespondto usedfor four differentpurposes,regardlessof the eachtypeof the ADVsusedin this implementationare summarizedin Propertiesof AdvertisingPacketsUID/URL/TLMF rameURLC onfigurationModeADVADVE ventTypeADV_NONCONN_INDADV_INDADVTypeFla gsBREDR_NOT_SUPPORTEDBREDR_NOT_SUPPORTED |GENERAL_DISCOVERABLEADVI ntervalFromURLCfg for UID/URL,10 timeslongerfor TLMD efaultIntervalTX Implementation5 SWRA491A September2015 RevisedOctober2016 SubmitDocumentationFeedbackCopyright 2015 2016,TexasInstrumentsIncorporatedImpleme ntingEddystoneBluetoothSmartBeaconsUsing the TI BLE-StackAs switchingfromone advertisingpacketto anotherat run time is required,how to set the parameterstochangethe propertiesfor regularadvertisingmodeis describedin this get the informationto populatethe payloadof eachpacketis also shownin Table2, thereare five propertiesto be changedwhentogglingbetweenregularadverti singmodeand be configuredusingGAPRole_SetParameter(), withGAPROLE_ADV_EVENT_TYPEas the parameterID and GAP_ADTYPE_ADV_NONCONN_INDas thevalue,becauseregularadvertisingmodeis an item includedin an GAP_ADTYPE_FLAGS field of thestructvariableeddystoneAdvfor regularadvertisingmodeis initializedwithGAP_ADTYPE_FLAGS_BREDR_NO T_SUPPORTED,becauseregularadvertisingmod eis set by specifyingminimumand maximumintervalsfor limitedand ,all four parametersare set to the samevalueto get the desiredintervalas follows:GAP_SetParamValue(TGAP_LIM_DISC_ ADV_INT_MIN,advInt).

8 GAP_SetParamValue(TGAP_LIM_DISC_ADV_INT_ MAX,advInt);GAP_SetParamValue(TGAP_GEN_D ISC_ADV_INT_MIN,advInt);GAP_SetParamValu e(TGAP_GEN_DISC_ADV_INT_MAX,advInt);That particulardesignshouldselectadvertisingp arametersthat balancepowerusagewith beaconpoweruse. Usingfasteradvertisingintervalsallowsfor quickerdiscoveryby the smartdevice,whilelongerintervalsallowfor valuefromthe parametercorrespondingwith URLCFGSVC_BEACON_PERIODof the URLconfigurationserviceis reflectedonadvInt. Unit conversionis necessaryin this casebecausethe valuefromthe URLconfigurationserviceis in millisec,whileGAP_SetParamValue()expects a numberof beaconperiodfromthe URLconfigurationserviceis supposedto be appliedto ,itis usedfor UID as well in this implementation,becauseno externalmeansto setupthe intervalfor UID isdefinedin the intervalfor TLMdependson the intervalfor UID/URL,becauseit is basedon the numberof UID/URLframesthat havesent sincethe last TLMframein the valuefromthe parameterscorrespondingwith URLCFGSVC_ADV_TX_PWR_LVLSandURLCFGSVC_TX _POWER_MODEof the URLconfigurationserviceto get the designatedTX of the abovepropertiesare set and the ADVdatais updated,advertisingis readyto ,non-connectableadvertisingmodeis enabledto startsendingout the packetsat the givenrate ()

9 , with the parameterID GAPROLE_ADV_NONCONN_ENABLED,isusedto startor stop advertisingin the proceduresdescribedin this sectionare doneinSimpleEddystoneBeacon_applyConfigu ration()andSimpleEddystoneBeacon_startRe gularAdv(). EddystoneFramePayloadDatain UID and URLframesgenerallydon t needto be changedunlessthe beacondevicehas beenupdatedduringthe last RangingDatasubfieldof UID frameand allsubfieldsof URLframeexceptfor FrameTypemustbe implementedinSimpleEddystoneBeacon_apply Configuration().TI recommendsa few algorithmsto generatea 10-byteID Namespacesubfieldand a 6-byteID Instancesubfieldof UID by the implementationexampleusessomemeaningless numbers,but for an actualproduct,the numberassignmentsin functionSimpleEddystoneBeacon_initUID()m ustbe replacedwith September2015 RevisedOctober2016 SubmitDocumentationFeedbackCopyright 2015 2016,TexasInstrumentsIncorporatedImpleme ntingEddystoneBluetoothSmartBeaconsUsing the TI BLE-StackFor URLframe,SimpleEddystoneBeacon_encodeURL ()facilitatesconversionof regularnull-terminatedstringURLinto UID and URLframes,becausethe framedatamustbeupdatedwith the mostrecentinformationeachtime a TLMframeis TLMpayloadis doneinSimpleEddystoneBeacon_updateTLM().

10 The batteryvoltageVBATT subfieldcan be obtainedfromAONBatMonBatteryVoltageGet() . To use thebatterymonitorfunction, constantvalueis currentlyusedfor the temperatureTEMP subfield,becausethe CC2650 LaunchPaddoesnot havea ADV_CNTsubfieldneedsan eventfromthe stack,notifyingthe applicationuponcompletionof ()is the API to registeran eventthat is sent uponcompletionof an ADVsendout. RegisterSEB_ADV_COMPLETE_EVTand checkit in the processingloop of stackeventsthat comewith the signatureof eventSEB_ADV_COMPLETE_EVTiseventuallypro cessedinSimpleEddystoneBeacon_processAdv CompleteEvt(). This eventprocessingfunctionis not only for countingthe numberof ADVs,but also whichtype of 1-secresolutionclocktick counteris used,as an example,for SEC_CNTsubfield, ,originallyusedby the TimeAppexampleproject,was addedfor this. Typically,a TLMframeis supposedto be sent intermittently,so in thisexampleit is sent every10 secondsby default,allowingfor a localEddystoneframeis populatedwith all necessaryinformation,it mustbe handedoverto theBLE (), with the parameterID GAPROLE_ADVERT_DATA,is usedfor the proceduresdescribedin this sectionare handledbySimpleEddystoneBeacon_selectFra me().


Related search queries