LINE Beacon device specification
文章推薦指數: 80 %
Unlike LINE Simple Beacon (opens new window) packets, LINE Beacon packets contain the secure message field as a mechanism for security. # Requirements for ... Back News Products Documentation FAQ Glossary More MessagingAPItop APIreference Developmentguidelines Quickstart Guides LINEBotDesigner FlexMessage Concepts Reference Resources HomeDocumentationMessagingAPILINEBeacondevicespecification#LINEBeacondevicespecificationThistopicexplainstheLINEBeaconspecificationforenterpriseuserswhowishtodeploybeacondevicestousetheLINEBeaconfeature.TousetheLINEBeaconfeature,youneedtopreparebeacondevicescompliantwiththisspecification.UnlikeLINESimpleBeacon(opensnewwindow)packets,LINEBeaconpacketscontainthesecuremessagefieldasamechanismforsecurity.#RequirementsfordevicescompliantwiththeLINEBeaconspecificationAbeacondevicecompliantwiththeLINEBeaconspecificationsupportsBluetooth®LowEnergyVersion4.0andApple'siBeacon(opensnewwindow)andcanadvertiseLINEBeaconpackets.Specifically,thedevicemustmeetthefollowingrequirements:AdvertiseLINEBeaconpackets.GeneratethesecuremessagefromdatahashedbySHA-256andXOR(exclusiveOR)operations.Updatethesecuremessageevery15seconds.HaveauniqueHWIDanddisplayitonthebody.#LINEBeaconpacketYouneedtocontrolbeacondevicesaccordingtothebroadcasterrole(BLUETOOTHSPECIFICATIONVersion4.0[Vol3],PartCSection2.2.2.1)specifiedinthegenericaccessprofilesothatLINEcandetectthebeacondevicesquickly.#FormatoftheadvertisingdataTheadvertisingdataofaLINEBeaconpacketconsistsofthreeADstructures.Theformatandvaluestospecifyareasfollows.OctetFieldValueDescription00Length0x02ThedatalengthofthefirstADstructure(2bytes)01ADtype0x01ThisvalueindicatesthatADtypeisFlags.02ADdata0x06ThisvalueindicatesthattheflagsareLEGeneralDiscoverableModeandBR/EDRNotSupported.03Length0x03ThedatalengthofthesecondADstructure(3bytes)04ADtype0x03ThisvalueindicatesthatADtypeisCompletelistof16-bitUUIDsavailable.0516-bitUUID0x6FTogetherwiththenextbyte,thisvalueindicatesthe16-bitUUIDofLINE(0xFE6F).0616-bitUUID0xFETogetherwiththepreviousbyte,thisvalueindicatesthe16-bitUUIDofLINE(0xFE6F).07Length0x11ThedatalengthofthethirdADstructure(17bytes)08ADtype0x16ThisvalueindicatesthatADtypeisServiceData-16-bitUUID.0916-bitUUID0x6FTogetherwiththenextbyte,thisvalueindicatesthe16-bitUUIDofLINE(0xFE6F).1016-bitUUID0xFETogetherwiththepreviousbyte,thisvalueindicatesthe16-bitUUIDofLINE(0xFE6F).11Frametype0x02ThisvalueindicatesthattheframetypeisLINEBeacon.12-16HWIDDevice-specificvalue5-byteuniqueIDofthebeacondevice.Formoreinformation,seeHWID.17MeasuredTxPowerDevice-specificvalueRSSI(ReceivedSignalStrengthIndicator)whenthedistancebetweenthedevicewithLINEinstalledandthebeacondeviceis1meter.SetthesamevalueasfortheiBeaconpacket.Formoreinformation,seetheiBeacondocumentation.Setthisfieldto0x7Fifyoudon'tuseRSSIdata.18-21MessageauthenticationcodeVariable4-bytecodeformessageauthentication.Formoreinformation,seeGeneratingasecuremessage.22-23MaskedtimestampVariable2-bytemaskedtimestamp.Formoreinformation,seeGeneratingasecuremessage.24BatterylevelVariableRemainingbatterycapacity.Formoreinformation,seeBatterylevel.25-30Non-significantpart0x00Unusedpart.Seteachbyteto0x00.#PackettransmissionintervalWestronglyrecommendsendingLINEBeaconpacketsat152.5-msintervals.#SecuremessageThesecuremessageis7-bytedatathatconsistsofthemessageauthenticationcode,maskedtimestamp,andbatterylevel.Itisusedtopreventpackettamperingandreplayattacks.SecuremessagestransmittedfrombeacondevicesaresenttotheLINEPlatformviaLINEandthenverified.Thissectionexplainshowtogenerateasecuremessage.#GeneratingasecuremessageAsecuremessageisgeneratedbyperformingtheXOR(exclusiveOR)operationthreetimesonahashvaluecomputedwithSHA-256.Thefollowingfigureshowsthegenerationflowofthesecuremessage.Fortherequiredparameters,seeRequiredparameters.Generateasecuremessagebyfollowingthestepsbelow.#1.GenerateamessageauthenticationcodeConcatenatethefollowingitemsintheorderlistedandgeneratea32-bytehashvaluewithSHA-256.TimestampHWIDVendorkeyLotkeyBatterylevelPerformtheXORoperationonthefirst16bytesandthesecond16bytesofthehashvalue.PerformtheXORoperationonthefirst8bytesandsecond8bytesofthevaluecomputedinthepreviousstep.PerformtheXORoperationonthefirst4bytesandsecond4bytesofthevaluecomputedinthepreviousstep.Nowyouhavegeneratedamessageauthenticationcode.#2.GenerateamaskedtimestampMask6bytesfromthebeginningofthetimestampandleavethelast2bytes.Thisisamaskedtimestamp.#3.ConcatenateitemsConcatenatethefollowingitemsintheorderlisted:Messageauthenticationcodegeneratedinstep1Maskedtimestampgeneratedinstep2BatterylevelNowyouhavegeneratedasecuremessage.SeeSamplecodeanddataforgeneratingsecuremessages.Thistopichelpsyoudevelopandtestafunctiontoembedinbeacondevicestogeneratesecuremessages.#RequiredparametersThefollowingparametersareusedtogenerateasecuremessage.BatterylevelHWIDLotkeyTimestampVendorkeyLINECorporationgeneratesandmanagestheHWID,lotkey,andvendorkey.Fordetailsabouthowtoobtainthem,contactyourLINErepresentative.Servicesusingthelotkeyandvendorkeyareavailableonlytoenterpriseusers.#BatterylevelThisisremainingbatterycapacity.Usethisparametertodeterminewhentoreplacethebattery.Thefollowingtableshowsthemeaningofeachvalue.DecimalvalueHexadecimalvalueDescription00x00Unknownorconnectedtoanexternalpowersupply.10x010%available.Thebatteryisfullydischarged.20x0210%available………100x0A90%available110x0B100%available.Thebatteryisfullycharged.(12-255)0x0C-0xFFReservedforfutureuse.Donotuse.#HWIDHWIDisusedastheIDofabeacondevice.HWIDissuedbyLINECorporationisa10-characterstringinhexadecimalnotation.Convertittoabytearrayandwriteitintothebeacondeviceas5-bytebinarydata.PrinttheHWIDonthebodyofthebeacondevice.#LotkeyAlotkeyisassignedtoeachlot.LotkeysissuedbyLINECorporationare16-characterstrings.Convertittoabytearrayandwriteittothebeacondeviceas8-bytebinarydatainthesamewayastheHWID.#TimestampAtimestampisanunsigned64-bitinteger.Startincrementingwhenthebeacondeviceisturnedonforthefirsttime.Startthetimestampwithzeroandincrementevery15seconds.Fouristhetimestamponeminuteafterpower-on.Donotresetthetimestamptozerowhenthebeacondeviceisturnedonagain.Continuetoincrementthetimestampvalueatpower-off.#VendorkeyAvendorkeyisassignedtoeachvendor.AvendorkeyissuedbyLINECorporationisan8-characterstringinhexadecimalnotation.Convertittoabytearrayandwriteitintothebeacondeviceas4-bytebinarydataasyouwouldtheHWID.#iBeaconpacketWerecommendsendingiBeaconpacketstonotifyiOSdevicesthattheLINEBeacondeviceisnearby.FortheADstructureandtransmissionintervaloftheiBeaconpacket,seeApple'sProximityBeaconSpecificationdocument.YoucandownloadthisdocumentfromtheiBeaconsectionoftheAppleDevelopersite(opensnewwindow).ThefollowingtableshowstheparametersspecifictotheLINEBeaconspecificationthatyouneedtoincludeintheiBeaconpacket.ParameterValueUUIDD0D2CE24-9EFC-11E5-82C4-1C6A7A17EF38Major0x4C49Minor0x4E45
延伸文章資訊
- 1【教學】第一次設定LINE Beacon就上手!
請注意:如果您的LINE版本在11.1.0或以上,要記得先同意「LINE Beacon條款」,才能在LINE聊天室列表上方,收到LINE Beacon橫幅通知喔!
- 2LINE Beacon
LINE Beacon API 需由企業⾃⾏串接,可以根據⽤⼾UID發送分眾訊息。 LINE Beacon 技術⽂件:https://developers.line.biz/zh-hant/do...
- 3LINE Beacon服務條款 - 台北數位集團
LINE Beacon(以下稱為「本功能」)為接收由稱為Beacon的藍芽傳輸機器向LINE所傳輸訊號的功能。透過設置於商店和其他地點的Beacon,用戶可接收優惠好康、便利資訊以及 ...
- 4LINE BEACON 開啟行銷空戰:藍芽推播、偵測停留、線上線下 ...
IKEA 也在店內不同的展區如沙發區、兒童區,設置Beacon,讓LINE 扮演虛擬導購員,透過停留時間,可以從對應的推播內容,了解你想購買的家具,並利用LINE ...
- 5LINE Beacon device specification
Unlike LINE Simple Beacon (opens new window) packets, LINE Beacon packets contain the secure mess...