tmui-cli 5.3.2 → 5.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/components.json +1 -1
- package/data/config.json +1 -1
- package/data/doc-index.json +7 -2
- package/data/guides//345/201/234/346/255/242/345/205/254/345/221/212.md +29 -0
- package/data/guides//346/233/264/346/226/260/346/227/245/345/277/227.md +5 -1
- package/data/tmui4x/01./346/225/231/347/250/213/02./346/233/264/346/226/260/346/227/245/345/277/227.md +1214 -1183
- package/data/tmui4x/10./346/217/222/344/273/266/345/272/223/xCorrectS /346/226/207/346/241/243/346/240/241/346/255/243/344/270/216/350/257/206/345/210/253.md" +1 -1
- package/data/tmui4x/10./346/217/222/344/273/266/345/272/223/xOfficeU Office /346/226/207/346/241/243/347/274/226/350/276/221.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/205/266/345/256/203/347/273/204/344/273/266//344/272/214/347/273/264/347/240/201 xQrcoder.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/205/266/345/256/203/347/273/204/344/273/266//345/212/250/347/224/273 xAnimation.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/205/266/345/256/203/347/273/204/344/273/266//345/216/237/347/224/237/345/233/276/350/241/250 Chart.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/205/266/345/256/203/347/273/204/344/273/266//345/233/276/347/211/207/350/243/201/345/211/252 xImageResizer.md" +3 -3
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/205/266/345/256/203/347/273/204/344/273/266//345/233/276/350/241/250 xEchart.md" +2 -2
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/205/266/345/256/203/347/273/204/344/273/266//345/256/211/345/205/250/351/252/214/350/257/201 xSafeVerify.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/205/266/345/256/203/347/273/204/344/273/266//346/200/235/347/273/264/345/257/274/345/233/276 xTreeFlat.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/205/266/345/256/203/347/273/204/344/273/266//346/211/213/345/212/277/345/272/223 xFinger.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/205/266/345/256/203/347/273/204/344/273/266//346/217/220/345/217/212 xMention.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/205/266/345/256/203/347/273/204/344/273/266//346/235/241/347/240/201 xBarcode.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/205/266/345/256/203/347/273/204/344/273/266//346/273/221/345/212/250/351/252/214/350/257/201 xSlideVerify.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/205/266/345/256/203/347/273/204/344/273/266//347/255/276/345/220/215/346/235/277 xSignBoard.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/205/266/345/256/203/347/273/204/344/273/266//351/242/234/350/211/262/351/200/211/346/213/251 xColorView.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/205/266/345/256/203/347/273/204/344/273/266//351/252/214/350/257/201/347/240/201/350/276/223/345/205/245/346/241/206 xCodeInput.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/217/215/351/246/210/347/273/204/344/273/266//344/270/213/346/213/211/345/210/267/346/226/260 xPullRefresh.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/217/215/351/246/210/347/273/204/344/273/266//344/270/213/346/213/211/350/217/234/345/215/225 xDropdownMenu.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/217/215/351/246/210/347/273/204/344/273/266//344/270/213/346/213/211/350/217/234/345/215/225/345/255/220/347/273/204/344/273/266 xDropdownItem.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/217/215/351/246/210/347/273/204/344/273/266//345/212/240/350/275/275/344/270/255 xLoading.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/217/215/351/246/210/347/273/204/344/273/266//345/212/250/344/275/234/350/217/234/345/215/225/351/235/242/346/235/277 xActionMenu.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/217/215/351/246/210/347/273/204/344/273/266//345/257/271/350/257/235/346/241/206 xModal.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/217/215/351/246/210/347/273/204/344/273/266//345/267/246/346/273/221/350/217/234/345/215/225 xSwitchSlider.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/217/215/351/246/210/347/273/204/344/273/266//345/272/225/351/203/250/345/257/271/350/257/235/346/241/206 xActionModal.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/217/215/351/246/210/347/273/204/344/273/266//345/274/271/345/271/225 Barrage.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/217/215/351/246/210/347/273/204/344/273/266//345/274/271/345/271/225/345/255/220/350/212/202/347/202/271 xBarrageItem.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/217/215/351/246/210/347/273/204/344/273/266//346/212/275/345/261/211 xDrawer.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/217/215/351/246/210/347/273/204/344/273/266//346/213/226/346/213/275/346/216/222/345/272/217 xDrag.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/217/215/351/246/210/347/273/204/344/273/266//346/213/226/346/213/275/346/216/222/345/272/217/345/255/220/347/273/204/344/273/266 xDragItem.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/217/215/351/246/210/347/273/204/344/273/266//346/261/275/346/263/241/350/217/234/345/215/225 xPopover.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/217/215/351/246/210/347/273/204/344/273/266//346/265/256/345/212/250/351/235/242/346/235/277 FloatDrawer.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/217/215/351/246/210/347/273/204/344/273/266//346/265/256/347/220/203 xFloatButton.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/217/215/351/246/210/347/273/204/344/273/266//346/266/210/346/201/257/346/235/241 xSnackbar.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/217/215/351/246/210/347/273/204/344/273/266//346/266/210/346/201/257/346/235/241/345/255/220/350/212/202/347/202/271 xSnackbarItem.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/217/215/351/246/210/347/273/204/344/273/266//346/266/210/346/201/257/351/200/232/347/237/245 xMsgNotice.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/217/215/351/246/210/347/273/204/344/273/266//351/201/256/347/275/251 xOverlay.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/257/274/350/210/252/347/273/204/344/273/266//344/276/247/350/276/271/345/210/206/347/261/273 xSliderTree.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/257/274/350/210/252/347/273/204/344/273/266//344/276/247/350/276/271/345/210/206/347/261/273/345/255/220/350/212/202/347/202/271 xSliderTreeChildren.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/257/274/350/210/252/347/273/204/344/273/266//344/276/247/350/276/271/350/217/234/345/215/225 xSliderMenu.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/257/274/350/210/252/347/273/204/344/273/266//345/215/225/351/200/211/346/214/211/351/222/256/347/273/204 xRadioButton.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/257/274/350/210/252/347/273/204/344/273/266//345/256/253/346/240/274 xGrid.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/257/274/350/210/252/347/273/204/344/273/266//345/256/253/346/240/274/345/255/220/347/273/204/344/273/266 xGridItem.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/257/274/350/210/252/347/273/204/344/273/266//345/272/225/351/203/250/345/257/274/350/210/252 xTabbar.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/257/274/350/210/252/347/273/204/344/273/266//345/274/225/345/257/274 xGuid.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/257/274/350/210/252/347/273/204/344/273/266//345/274/225/345/257/274/345/255/220/347/273/204/344/273/266 xGuidItem.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/257/274/350/210/252/347/273/204/344/273/266//346/220/234/347/264/242/346/240/217 xSearch.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/257/274/350/210/252/347/273/204/344/273/266//346/227/266/351/227/264/345/221/250 xWeekbar.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/257/274/350/210/252/347/273/204/344/273/266//346/240/207/347/255/276/345/257/274/350/210/252 xTabs.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/257/274/350/210/252/347/273/204/344/273/266//346/240/207/351/242/230/345/257/274/350/210/252 xNavbar.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/257/274/350/210/252/347/273/204/344/273/266//347/262/230/346/200/247/345/270/203/345/261/200 Sticky.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/257/274/350/210/252/347/273/204/344/273/266//347/264/242/345/274/225 xIndexbar.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/257/274/350/210/252/347/273/204/344/273/266//350/277/224/345/233/236/351/241/266/351/203/250 xBacktop.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266/markdown xCmarkdown.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//345/200/222/350/256/241/346/227/266 xCountdown.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//345/210/206/345/211/262/347/272/277 xDivider.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//345/210/227/350/241/250 xCell.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//345/212/250/346/200/201/345/205/250/345/261/217 xViewTofull.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//345/215/241/347/211/207 xCard.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//345/233/276/347/211/207 xImage.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//345/233/276/351/233/206 xImageGroup.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//345/234/206/345/275/242/350/277/233/345/272/246/347/216/257 xCircleProgress.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//345/244/264/345/203/217/347/273/204 xAvatarGroup.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//345/257/214/346/226/207/346/234/254 xHtml.md" +3 -3
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//345/257/214/346/226/207/346/234/254/345/255/220/347/273/204/344/273/266 xHtmlNode.md" +3 -3
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//346/212/230/345/217/240/351/235/242/346/235/277 xCollapse.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//346/212/230/345/217/240/351/235/242/346/235/277/345/255/220/347/273/204/344/273/266 xCollapseItem.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//346/225/260/345/255/227/347/277/273/346/273/232 xRollingNumber.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//346/237/245/347/234/213/346/233/264/345/244/232 xMore.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//346/250/252/345/220/221/346/273/232/345/212/250 xScrollx.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//346/255/245/351/252/244/346/235/241 xSteps.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//346/255/245/351/252/244/346/235/241/345/255/220/347/273/204/344/273/266 xStepsItem.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//346/260/264/345/215/260 xWatermark.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//347/200/221/345/270/203/346/265/201 xWaterfall.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//347/251/272/347/212/266/346/200/201 xEmpty.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//350/231/232/346/213/237/345/210/227/350/241/250 xVirtualList.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//350/241/250/346/240/274 xTable.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//350/241/250/346/240/274/345/210/227 xTableCol.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//350/247/222/346/240/207 xBadge.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//350/255/246/345/221/212 xAlert.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//350/257/215/344/272/221 xTextCloud.md" +8 -3
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//350/277/233/345/272/246/346/235/241 xProgress.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//351/200/232/347/237/245/346/240/217 xNotice.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//351/207/221/351/242/235/346/240/205/346/240/274 xMoney.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//351/223/276/346/216/245 xLink.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//351/252/250/346/236/266/345/261/217 xSkeleton.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/270/270/347/224/250/347/273/204/344/273/266//345/223/215/345/272/224/345/274/217/345/270/203/345/261/200 xLayout.md" +15 -25
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/270/270/347/224/250/347/273/204/344/273/266//345/233/276/346/240/207 xIcon.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/270/270/347/224/250/347/273/204/344/273/266//345/256/271/345/231/250 xSheet.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/270/270/347/224/250/347/273/204/344/273/266//345/270/203/345/261/200 xRow.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/270/270/347/224/250/347/273/204/344/273/266//345/270/203/345/261/200/345/255/220/347/273/204/344/273/266 xCol.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/270/270/347/224/250/347/273/204/344/273/266//346/214/211/351/222/256 xButton.md" +74 -72
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/270/270/347/224/250/347/273/204/344/273/266//346/226/207/346/234/254 xText.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/270/270/347/224/250/347/273/204/344/273/266//346/240/207/347/255/276 xTag.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//345/215/225/346/273/221/345/235/227 xSlider.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//345/215/225/351/200/211/346/241/206 xRadio.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//345/215/225/351/200/211/346/241/206/347/273/204 xRadioGroup.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//345/217/214/345/220/221/346/273/221/345/235/227 xSliderDouble.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//345/233/276/347/211/207/344/270/212/344/274/240 xUploadMedia.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//345/237/216/345/270/202/351/200/211/346/213/251/345/231/250 xPickerCity.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//345/244/232/351/200/211/346/227/245/345/216/206 xCalendarMultiple.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//345/244/232/351/200/211/346/241/206 xCheckbox.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//345/244/232/351/200/211/346/241/206/347/273/204 xCheckboxGroup.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//345/257/206/347/240/201/351/224/256/347/233/230 xKeyboard.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//345/257/214/346/226/207/346/234/254/347/274/226/350/276/221/345/231/250 xEditor.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//345/265/214/345/205/245/345/274/217/346/227/245/346/234/237/351/200/211/346/213/251/345/231/250 xDateView.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//345/274/200/345/205/263 xSwitch.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//346/220/234/347/264/242/351/200/211/346/213/251 xpickerSelected.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//346/225/260/345/255/227/351/224/256/347/233/230 xKeyboardNumber.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//346/226/207/344/273/266/351/200/211/346/213/251 xUploadFile.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//346/227/245/345/216/206 xCalendar.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//346/227/245/346/234/237/351/200/211/346/213/251/345/231/250 xPickerDate.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//346/227/266/351/227/264/345/214/272/351/227/264/351/200/211/346/213/251 xBetweenTime.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//346/227/266/351/227/264/351/200/211/346/213/251/345/231/250 xPickerTime.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//346/236/201/350/201/224/345/231/250 xCascader.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//346/240/207/347/255/276/350/276/223/345/205/245/346/241/206 xInputTag.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//346/240/221 xTree.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//346/255/245/350/277/233/345/231/250 xStepper.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//347/277/273/351/241/265/345/231/250 xPagination.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//350/241/250/345/215/225 xForm.md" +139 -3
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//350/241/250/345/215/225/345/255/220/347/273/204/344/273/266 xFormItem.md" +139 -4
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//350/257/204/345/210/206 xRate.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//350/272/253/344/273/275/350/257/201/351/224/256/347/233/230 xKeyboardIdcard.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//350/275/246/347/211/214/351/224/256/347/233/230 xKeyboardCar.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//350/276/223/345/205/245/346/241/206 xInput.md" +2 -2
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//350/276/223/345/205/245/346/241/206 xInputNumber.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//351/200/211/346/213/251/345/231/250 xPicker.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//351/200/211/346/213/251/345/231/250/345/256/271/345/231/250 xPickerView.md" +1 -1
- package/data/tmui4x/60.AI/350/207/252/345/212/250/345/214/226/06.tokens/350/207/252/347/224/261.md +2 -6
- package/data/tmui4x-doc-index.json +1 -1
- package/data/uni-app-x-docs/.vuepress/utils/customTypeJson.json +1 -1
- package/data/uni-app-x-docs/.vuepress/utils/utsApiJson.json +1 -1
- package/data/uni-app-x-docs/.vuepress/utils/utsComJson.json +1 -1
- package/data/uni-app-x-docs/.vuepress/utils/utsJson.json +1 -1
- package/data/uni-app-x-docs/_sidebar.md +1 -0
- package/data/uni-app-x-docs/api/_sidebar.md +3 -0
- package/data/uni-app-x-docs/api/bluetooth-general.md +280 -0
- package/data/uni-app-x-docs/api/bluetooth-le-central.md +376 -0
- package/data/uni-app-x-docs/api/keyboard.md +6 -0
- package/data/uni-app-x-docs/api/memory.md +1 -1
- package/data/uni-app-x-docs/api/scrollviewcontext.md +111 -0
- package/data/uni-app-x-docs/api/unicloud/README.md +1 -1
- package/data/uni-app-x-docs/app-vapor.md +2 -41
- package/data/uni-app-x-docs/collocation/manifest-android.md +1 -1
- package/data/uni-app-x-docs/component/_sidebar.md +2 -1
- package/data/uni-app-x-docs/component/common.md +48 -2
- package/data/uni-app-x-docs/component/datacom.md +823 -0
- package/data/uni-app-x-docs/component/input.md +2 -2
- package/data/uni-app-x-docs/component/label.md +1 -1
- package/data/uni-app-x-docs/component/map.md +12 -12
- package/data/uni-app-x-docs/component/text.md +7 -3
- package/data/uni-app-x-docs/component/textarea.md +2 -6
- package/data/uni-app-x-docs/component/uni-ui-x/uni-expandable-text.md +22 -0
- package/data/uni-app-x-docs/component/web-view.md +65 -0
- package/data/uni-app-x-docs/css/common/style-isolation.md +8 -0
- package/data/uni-app-x-docs/css/word-break.md +3 -0
- package/data/uni-app-x-docs/native/download/android.md +83 -103
- package/data/uni-app-x-docs/native/download/ios.md +10 -10
- package/data/uni-app-x-docs/readme.md +2 -1
- package/data/uni-app-x-docs/release-note-alpha.md +39 -0
- package/data/uni-app-x-docs/release.md +144 -1
- package/data/uni-app-x-docs/sample.md +15 -12
- package/data/uni-app-x-docs/static/bluetooth-general-flow.svg +69 -0
- package/data/uni-app-x-docs/static/bluetooth-le-central-flow.svg +102 -0
- package/data/uniappx/_sidebar.md +1 -0
- package/data/uniappx/api/_sidebar.md +3 -0
- package/data/uniappx/api/app-route.md +10 -10
- package/data/uniappx/api/bluetooth-general.md +822 -0
- package/data/uniappx/api/bluetooth-le-central.md +1044 -0
- package/data/uniappx/api/calendar.md +4 -4
- package/data/uniappx/api/compress-image.md +1 -1
- package/data/uniappx/api/contact.md +0 -4
- package/data/uniappx/api/convert2-abs-full-path.md +4 -0
- package/data/uniappx/api/create-canvas-context-async.md +0 -4
- package/data/uniappx/api/create-inner-audio-context.md +1 -1
- package/data/uniappx/api/get-app-base-info.md +1 -1
- package/data/uniappx/api/get-location.md +2 -2
- package/data/uniappx/api/get-recorder-manager.md +1 -1
- package/data/uniappx/api/get-video-info.md +1 -1
- package/data/uniappx/api/gyroscope.md +8 -8
- package/data/uniappx/api/install-wgt.md +4 -0
- package/data/uniappx/api/keyboard.md +6 -0
- package/data/uniappx/api/loading.md +2 -2
- package/data/uniappx/api/memory.md +1 -1
- package/data/uniappx/api/modal.md +1 -1
- package/data/uniappx/api/preview-image.md +4 -4
- package/data/uniappx/api/report.md +0 -4
- package/data/uniappx/api/request-system-permission.md +2 -2
- package/data/uniappx/api/screen-brightness.md +6 -6
- package/data/uniappx/api/scrollviewcontext.md +3 -0
- package/data/uniappx/api/toast.md +2 -2
- package/data/uniappx/api/uasm.md +4 -4
- package/data/uniappx/api/unicloud/README.md +1 -1
- package/data/uniappx/api/uniresizeobserver.md +144 -27
- package/data/uniappx/api/vibrate.md +8 -0
- package/data/uniappx/app-vapor.md +2 -41
- package/data/uniappx/collocation/manifest-android.md +1 -1
- package/data/uniappx/component/_sidebar.md +2 -1
- package/data/uniappx/component/animation-view.md +2 -2
- package/data/uniappx/component/camera.md +1 -1
- package/data/uniappx/component/canvas.md +2 -2
- package/data/uniappx/component/common.md +48 -1
- package/data/uniappx/component/datacom.md +683 -0
- package/data/uniappx/component/editor.md +1 -1
- package/data/uniappx/component/image.md +1 -1
- package/data/uniappx/component/input.md +2 -2
- package/data/uniappx/component/label.md +1 -1
- package/data/uniappx/component/map.md +12 -12
- package/data/uniappx/component/progress.md +3 -3
- package/data/uniappx/component/radio.md +1 -1
- package/data/uniappx/component/rich-text.md +3 -3
- package/data/uniappx/component/swiper.md +1 -1
- package/data/uniappx/component/switch.md +2 -2
- package/data/uniappx/component/text.md +9 -5
- package/data/uniappx/component/textarea.md +2 -6
- package/data/uniappx/component/uni-ui-x/README.md +21 -19
- package/data/uniappx/component/uni-ui-x/uni-collapse.md +8 -0
- package/data/uniappx/component/uni-ui-x/uni-combox.md +19 -0
- package/data/uniappx/component/uni-ui-x/uni-drag-cell.md +4 -0
- package/data/uniappx/component/uni-ui-x/uni-expandable-text.md +120 -0
- package/data/uniappx/component/uni-ui-x/uni-fab-button.md +4 -0
- package/data/uniappx/component/uni-ui-x/uni-icons.md +60 -18
- package/data/uniappx/component/uni-ui-x/uni-index-bar.md +4 -0
- package/data/uniappx/component/uni-ui-x/uni-link.md +4 -0
- package/data/uniappx/component/uni-ui-x/uni-nav-bar.md +4 -0
- package/data/uniappx/component/uni-ui-x/uni-number-box.md +4 -0
- package/data/uniappx/component/uni-ui-x/uni-rate.md +2 -2
- package/data/uniappx/component/uni-ui-x/uni-refresh-box.md +4 -0
- package/data/uniappx/component/uni-ui-x/uni-tab.md +16 -0
- package/data/uniappx/component/uni-ui-x/uni-time-format.md +4 -0
- package/data/uniappx/component/view.md +1 -1
- package/data/uniappx/component/waterflow.md +1 -1
- package/data/uniappx/component/web-view.md +54 -1
- package/data/uniappx/css/common/style-isolation.md +8 -0
- package/data/uniappx/css/word-break.md +3 -0
- package/data/uniappx/native/download/android.md +80 -100
- package/data/uniappx/native/download/ios.md +10 -10
- package/data/uniappx/readme.md +2 -1
- package/data/uniappx/release-note-alpha.md +39 -0
- package/data/uniappx/release.md +143 -0
- package/data/uniappx/sample.md +15 -12
- package/data/uniappx/uts/buildin-object-api/global.md +2 -2
- package/data/uniappx/uts/buildin-object-api/utsjsonobject.md +4 -0
- package/data/uniappx-doc-index.json +99 -25
- package/package.json +1 -1
|
@@ -127,6 +127,7 @@
|
|
|
127
127
|
* [安卓、鸿蒙厂商推送配置](uni-push/vendor_config.md)
|
|
128
128
|
* [谷歌FCM配置](uni-push/google-fcm.md)
|
|
129
129
|
* [uni统计](https://uniapp.dcloud.net.cn/uni-stat-uniappx)
|
|
130
|
+
* [App升级中心](https://doc.dcloud.net.cn/uniCloud/upgrade-center.html)
|
|
130
131
|
* 教程
|
|
131
132
|
* [性能优化](performance.md)
|
|
132
133
|
* [复杂列表开发指南](tutorial/stickynestlist.md)
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
* [设置tabBar](set-tab-bar.md)
|
|
30
30
|
* [页面下拉刷新](pull-down-refresh.md)
|
|
31
31
|
* [将页面滚动到指定位置](page-scroll-to.md)
|
|
32
|
+
<!-- * [ScrollViewContext](scrollviewcontext.md) -->
|
|
32
33
|
* [监听中间按钮的点击事件](on-tab-bar-mid-button-tap.md)
|
|
33
34
|
* [窗口](window.md)
|
|
34
35
|
* [宽屏适配](wide-screen-adaptation.md)
|
|
@@ -82,6 +83,8 @@
|
|
|
82
83
|
* [安装 APK](install-apk.md)
|
|
83
84
|
* [监听权限申请](create-request-permission-listener.md)
|
|
84
85
|
* [请求系统权限](request-system-permission.md)
|
|
86
|
+
* [蓝牙-通用](bluetooth-general.md)
|
|
87
|
+
* [蓝牙-低功耗中心设备](bluetooth-le-central.md)
|
|
85
88
|
* 媒体
|
|
86
89
|
* [拍照或从相册选择图片](choose-image.md)
|
|
87
90
|
* [图片预览](preview-image.md)
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
::: warning 注意事项
|
|
2
|
+
|
|
3
|
+
使用蓝牙能力前,需先调用 [uni.openBluetoothAdapter](#openbluetoothadapter) 初始化蓝牙适配器,并确认初始化成功。调用 [uni.closeBluetoothAdapter](#closebluetoothadapter) 或应用进程结束后,再次使用时需重新初始化。监听类接口可提前注册。
|
|
4
|
+
|
|
5
|
+
:::
|
|
6
|
+
|
|
7
|
+
## 模块介绍
|
|
8
|
+
|
|
9
|
+
蓝牙规范由蓝牙技术联盟(SIG)制定,主流有两种规格:**经典蓝牙(BR/EDR)** 用于音箱、耳机等较大带宽场景;**蓝牙低功耗(BLE,蓝牙 4.0 起)** 功耗低、适合小数据量传输,常见于智能穿戴、传感器、智能家居等设备。
|
|
10
|
+
|
|
11
|
+
本文与[蓝牙-低功耗中心设备](./bluetooth-le-central.md)介绍 BLE 中心设备能力,用于发现并连接蓝牙低功耗外设,不用于经典蓝牙设备的数据通信。接口按职责分为两部分:
|
|
12
|
+
|
|
13
|
+
- **蓝牙-通用**:初始化/关闭适配器、监听适配器状态、扫描与发现设备、获取设备列表;
|
|
14
|
+
- **[蓝牙-低功耗中心设备](./bluetooth-le-central.md)**:连接设备、发现服务与特征值、读写特征值、订阅通知、MTU 等。
|
|
15
|
+
|
|
16
|
+
当前支持微信小程序(uni-app x 4.41 起)和支付宝小程序(uni-app x 5.31 起),App 端暂不支持。各接口的具体支持范围及最低支持版本以兼容性表为准。
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## 使用流程
|
|
20
|
+
|
|
21
|
+
<a href="../static/bluetooth-general-flow.svg" target="_blank" rel="noopener"><img src="../static/bluetooth-general-flow.svg" alt="蓝牙通用接口使用流程:注册监听、初始化、扫描发现设备、停止扫描、连接通信及清理资源" width="400"></a>
|
|
22
|
+
|
|
23
|
+
1. 注册 [uni.onBluetoothAdapterStateChange](#onbluetoothadapterstatechange) 和 [uni.onBluetoothDeviceFound](#onbluetoothdevicefound),分别监听适配器状态和设备发现事件。
|
|
24
|
+
2. 调用 [uni.openBluetoothAdapter](#openbluetoothadapter),初始化成功后调用 [uni.startBluetoothDevicesDiscovery](#startbluetoothdevicesdiscovery) 开始扫描。
|
|
25
|
+
3. 通过设备发现事件获取目标设备的 `deviceId`,也可调用 [uni.getBluetoothDevices](#getbluetoothdevices) 获取已发现的设备列表。
|
|
26
|
+
4. 发现目标设备后,调用 [uni.stopBluetoothDevicesDiscovery](#stopbluetoothdevicesdiscovery) 停止扫描,再连接设备并通信,见[蓝牙-低功耗中心设备](./bluetooth-le-central.md)。
|
|
27
|
+
5. 使用结束后,移除当前页面或组件注册的监听;不再使用蓝牙能力时,调用 [uni.closeBluetoothAdapter](#closebluetoothadapter) 释放适配器。
|
|
28
|
+
|
|
29
|
+
## 权限@permission
|
|
30
|
+
|
|
31
|
+
### iOS
|
|
32
|
+
|
|
33
|
+
- 蓝牙访问需要 `NSBluetoothAlwaysUsageDescription` 隐私说明,并获得用户授权。发行时应确认最终应用包含符合实际用途的权限说明。
|
|
34
|
+
- 系统蓝牙开关与应用蓝牙权限是两个独立条件。系统蓝牙已开启,不代表应用已获授权。
|
|
35
|
+
|
|
36
|
+
### 微信小程序和支付宝小程序
|
|
37
|
+
|
|
38
|
+
需分别遵循微信小程序和支付宝小程序的蓝牙授权要求与平台限制。各接口的支持范围以对应的兼容性表为准。
|
|
39
|
+
|
|
40
|
+
## 注意事项@tips
|
|
41
|
+
|
|
42
|
+
### 设备发现与连接
|
|
43
|
+
|
|
44
|
+
- **使用扫描返回的 deviceId**:通过设备发现事件或已发现的设备列表获取目标设备的 `deviceId`,再用于后续连接和通信。
|
|
45
|
+
- **iOS 设备标识**:连接设备前需先扫描发现设备,仅保存设备 ID 不能代替设备发现。iOS 的 `deviceId` 来自系统分配的 UUID,不应假设它跨手机、跨安装或跨会话始终不变。
|
|
46
|
+
- **及时停止扫描**:扫描较耗电,发现目标设备后应尽快停止扫描。
|
|
47
|
+
|
|
48
|
+
适配器可用不代表设备已连接。监听设备连接状态时,使用 [uni.onBLEConnectionStateChange](./bluetooth-le-central.md#onbleconnectionstatechange),通过回调中的 `deviceId` 和 `connected` 判断目标设备是否连接。
|
|
49
|
+
|
|
50
|
+
### 事件监听
|
|
51
|
+
|
|
52
|
+
- **监听与取消监听成对使用**:页面或组件卸载时,调用对应的 `off*` 移除自身注册的监听,避免重复监听或影响其他页面。
|
|
53
|
+
- **iOS 监听 ID**:可保存 `on*` 返回的监听 ID,并将该 ID 传给对应的 `off*`,仅移除自身注册的监听,避免清空其他页面的监听。
|
|
54
|
+
|
|
55
|
+
### 适配器状态与权限
|
|
56
|
+
|
|
57
|
+
- **适配器由应用共享**:关闭适配器会影响其他页面正在进行的蓝牙操作,应统一管理其生命周期。
|
|
58
|
+
- **蓝牙关闭后的恢复**:系统蓝牙关闭后,现有扫描与连接会失效。重新开启后,应根据适配器可用状态重新扫描、连接,并重新发现服务与特征值、订阅通知。
|
|
59
|
+
|
|
60
|
+
系统蓝牙开关和应用蓝牙权限需分别检查。先注册 [uni.onBluetoothAdapterStateChange](#onbluetoothadapterstatechange) 并调用 [uni.openBluetoothAdapter](#openbluetoothadapter) 初始化。
|
|
61
|
+
|
|
62
|
+
以下操作路径及事件表现为 **iOS 平台差异**,不作为其他平台的操作说明:
|
|
63
|
+
|
|
64
|
+
| 操作路径 | 事件表现 | uni API 处理方式 |
|
|
65
|
+
| --- | --- | --- |
|
|
66
|
+
| 设置 → 蓝牙:主开关 | 应用进程存活时,会触发适配器状态变化事件 | 在 `onBluetoothAdapterStateChange` 回调中通过 `available` 判断是否可用。关闭时停止后续蓝牙操作;重新开启且 `available` 为 `true` 后,按需重新扫描和连接。 |
|
|
67
|
+
| 设置 → App → 蓝牙:应用权限 | 系统会终止 App,不能依赖原进程继续接收事件 | 重新启动后,重新注册监听并调用 `openBluetoothAdapter`,根据成功或失败回调处理授权结果。 |
|
|
68
|
+
| 控制中心:蓝牙按钮 | 通常不会触发适配器状态变化事件 | 适配器仍可能可用,不能用此操作代替系统蓝牙主开关测试。设备是否断开应通过 `onBLEConnectionStateChange` 判断。 |
|
|
69
|
+
|
|
70
|
+
### 后台运行
|
|
71
|
+
|
|
72
|
+
iOS 应用进行后台蓝牙操作需声明 `bluetooth-central` 后台模式,但后台扫描与连接仍受系统调度限制,不能保证与前台行为一致。
|
|
73
|
+
|
|
74
|
+
### 初始化失败处理
|
|
75
|
+
|
|
76
|
+
以下错误码及处理方式适用于 App,微信小程序和支付宝小程序的错误码说明详见其文档。
|
|
77
|
+
|
|
78
|
+
| errCode | 含义 | 建议处理 |
|
|
79
|
+
| --- | --- | --- |
|
|
80
|
+
| `1509602` | 应用未获得蓝牙权限 | 引导用户在“设置 → App → 蓝牙”中授权。权限变更导致 App 重新启动后,重新注册监听并初始化。 |
|
|
81
|
+
| `1509603` | 系统蓝牙已关闭 | 引导用户在“设置 → 蓝牙”中开启主开关,恢复后重新调用初始化。 |
|
|
82
|
+
| `1500102` | 适配器暂不可用 | 等待适配器恢复可用后再尝试,不要连续反复初始化。 |
|
|
83
|
+
| `1509010` | 初始化时等待适配器状态超时 | 稍后重试初始化,并检查系统蓝牙状态;该错误不同于连接设备时的 `1509005`。 |
|
|
84
|
+
| `1500105` | 系统或平台不支持该蓝牙能力 | 检查接口兼容性及运行环境,重复调用不能消除此限制。 |
|
|
85
|
+
| `1500104` / `1509000` | 系统调用失败或其他错误 | 记录接口名、`errCode`、`errMsg` 及可用的错误详情,结合真机环境进一步排查。 |
|
|
86
|
+
|
|
87
|
+
<!-- UTSAPIJSON.openBluetoothAdapter.name -->
|
|
88
|
+
|
|
89
|
+
<!-- UTSAPIJSON.openBluetoothAdapter.description -->
|
|
90
|
+
|
|
91
|
+
<!-- UTSAPIJSON.openBluetoothAdapter.compatibility -->
|
|
92
|
+
|
|
93
|
+
<!-- UTSAPIJSON.openBluetoothAdapter.param -->
|
|
94
|
+
|
|
95
|
+
<!-- UTSAPIJSON.openBluetoothAdapter.fileFormats -->
|
|
96
|
+
|
|
97
|
+
<!-- UTSAPIJSON.openBluetoothAdapter.returnValue -->
|
|
98
|
+
|
|
99
|
+
<!-- UTSAPIJSON.openBluetoothAdapter.example -->
|
|
100
|
+
|
|
101
|
+
<!-- UTSAPIJSON.openBluetoothAdapter.tutorial -->
|
|
102
|
+
|
|
103
|
+
### 使用说明
|
|
104
|
+
|
|
105
|
+
- 初始化成功只表示应用可以使用蓝牙适配器,不代表已扫描到设备或建立连接。应在成功回调后开始扫描,再按[中心设备使用流程](./bluetooth-le-central.md#使用流程)连接和通信。
|
|
106
|
+
- 初始化失败时,应根据失败回调处理原因,待相关条件恢复后重新初始化,不要继续扫描或连接。
|
|
107
|
+
|
|
108
|
+
<!-- UTSAPIJSON.closeBluetoothAdapter.name -->
|
|
109
|
+
|
|
110
|
+
<!-- UTSAPIJSON.closeBluetoothAdapter.description -->
|
|
111
|
+
|
|
112
|
+
<!-- UTSAPIJSON.closeBluetoothAdapter.compatibility -->
|
|
113
|
+
|
|
114
|
+
<!-- UTSAPIJSON.closeBluetoothAdapter.param -->
|
|
115
|
+
|
|
116
|
+
<!-- UTSAPIJSON.closeBluetoothAdapter.fileFormats -->
|
|
117
|
+
|
|
118
|
+
<!-- UTSAPIJSON.closeBluetoothAdapter.returnValue -->
|
|
119
|
+
|
|
120
|
+
<!-- UTSAPIJSON.closeBluetoothAdapter.example -->
|
|
121
|
+
|
|
122
|
+
<!-- UTSAPIJSON.closeBluetoothAdapter.tutorial -->
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
<!-- UTSAPIJSON.getBluetoothAdapterState.name -->
|
|
126
|
+
|
|
127
|
+
<!-- UTSAPIJSON.getBluetoothAdapterState.description -->
|
|
128
|
+
|
|
129
|
+
<!-- UTSAPIJSON.getBluetoothAdapterState.compatibility -->
|
|
130
|
+
|
|
131
|
+
<!-- UTSAPIJSON.getBluetoothAdapterState.param -->
|
|
132
|
+
|
|
133
|
+
<!-- UTSAPIJSON.getBluetoothAdapterState.fileFormats -->
|
|
134
|
+
|
|
135
|
+
<!-- UTSAPIJSON.getBluetoothAdapterState.returnValue -->
|
|
136
|
+
|
|
137
|
+
<!-- UTSAPIJSON.getBluetoothAdapterState.example -->
|
|
138
|
+
|
|
139
|
+
<!-- UTSAPIJSON.getBluetoothAdapterState.tutorial -->
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
<!-- UTSAPIJSON.onBluetoothAdapterStateChange.name -->
|
|
143
|
+
|
|
144
|
+
<!-- UTSAPIJSON.onBluetoothAdapterStateChange.description -->
|
|
145
|
+
|
|
146
|
+
<!-- UTSAPIJSON.onBluetoothAdapterStateChange.compatibility -->
|
|
147
|
+
|
|
148
|
+
<!-- UTSAPIJSON.onBluetoothAdapterStateChange.param -->
|
|
149
|
+
|
|
150
|
+
<!-- UTSAPIJSON.onBluetoothAdapterStateChange.fileFormats -->
|
|
151
|
+
|
|
152
|
+
<!-- UTSAPIJSON.onBluetoothAdapterStateChange.returnValue -->
|
|
153
|
+
|
|
154
|
+
<!-- UTSAPIJSON.onBluetoothAdapterStateChange.example -->
|
|
155
|
+
|
|
156
|
+
<!-- UTSAPIJSON.onBluetoothAdapterStateChange.tutorial -->
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
<!-- UTSAPIJSON.offBluetoothAdapterStateChange.name -->
|
|
160
|
+
|
|
161
|
+
<!-- UTSAPIJSON.offBluetoothAdapterStateChange.description -->
|
|
162
|
+
|
|
163
|
+
<!-- UTSAPIJSON.offBluetoothAdapterStateChange.compatibility -->
|
|
164
|
+
|
|
165
|
+
<!-- UTSAPIJSON.offBluetoothAdapterStateChange.param -->
|
|
166
|
+
|
|
167
|
+
<!-- UTSAPIJSON.offBluetoothAdapterStateChange.fileFormats -->
|
|
168
|
+
|
|
169
|
+
<!-- UTSAPIJSON.offBluetoothAdapterStateChange.returnValue -->
|
|
170
|
+
|
|
171
|
+
<!-- UTSAPIJSON.offBluetoothAdapterStateChange.example -->
|
|
172
|
+
|
|
173
|
+
<!-- UTSAPIJSON.offBluetoothAdapterStateChange.tutorial -->
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
<!-- UTSAPIJSON.startBluetoothDevicesDiscovery.name -->
|
|
177
|
+
|
|
178
|
+
<!-- UTSAPIJSON.startBluetoothDevicesDiscovery.description -->
|
|
179
|
+
|
|
180
|
+
<!-- UTSAPIJSON.startBluetoothDevicesDiscovery.compatibility -->
|
|
181
|
+
|
|
182
|
+
<!-- UTSAPIJSON.startBluetoothDevicesDiscovery.param -->
|
|
183
|
+
|
|
184
|
+
<!-- UTSAPIJSON.startBluetoothDevicesDiscovery.fileFormats -->
|
|
185
|
+
|
|
186
|
+
<!-- UTSAPIJSON.startBluetoothDevicesDiscovery.returnValue -->
|
|
187
|
+
|
|
188
|
+
<!-- UTSAPIJSON.startBluetoothDevicesDiscovery.example -->
|
|
189
|
+
|
|
190
|
+
<!-- UTSAPIJSON.startBluetoothDevicesDiscovery.tutorial -->
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
<!-- UTSAPIJSON.stopBluetoothDevicesDiscovery.name -->
|
|
194
|
+
|
|
195
|
+
<!-- UTSAPIJSON.stopBluetoothDevicesDiscovery.description -->
|
|
196
|
+
|
|
197
|
+
<!-- UTSAPIJSON.stopBluetoothDevicesDiscovery.compatibility -->
|
|
198
|
+
|
|
199
|
+
<!-- UTSAPIJSON.stopBluetoothDevicesDiscovery.param -->
|
|
200
|
+
|
|
201
|
+
<!-- UTSAPIJSON.stopBluetoothDevicesDiscovery.fileFormats -->
|
|
202
|
+
|
|
203
|
+
<!-- UTSAPIJSON.stopBluetoothDevicesDiscovery.returnValue -->
|
|
204
|
+
|
|
205
|
+
<!-- UTSAPIJSON.stopBluetoothDevicesDiscovery.example -->
|
|
206
|
+
|
|
207
|
+
<!-- UTSAPIJSON.stopBluetoothDevicesDiscovery.tutorial -->
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
<!-- UTSAPIJSON.onBluetoothDeviceFound.name -->
|
|
211
|
+
|
|
212
|
+
<!-- UTSAPIJSON.onBluetoothDeviceFound.description -->
|
|
213
|
+
|
|
214
|
+
<!-- UTSAPIJSON.onBluetoothDeviceFound.compatibility -->
|
|
215
|
+
|
|
216
|
+
<!-- UTSAPIJSON.onBluetoothDeviceFound.param -->
|
|
217
|
+
|
|
218
|
+
<!-- UTSAPIJSON.onBluetoothDeviceFound.fileFormats -->
|
|
219
|
+
|
|
220
|
+
<!-- UTSAPIJSON.onBluetoothDeviceFound.returnValue -->
|
|
221
|
+
|
|
222
|
+
<!-- UTSAPIJSON.onBluetoothDeviceFound.example -->
|
|
223
|
+
|
|
224
|
+
<!-- UTSAPIJSON.onBluetoothDeviceFound.tutorial -->
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
<!-- UTSAPIJSON.offBluetoothDeviceFound.name -->
|
|
228
|
+
|
|
229
|
+
<!-- UTSAPIJSON.offBluetoothDeviceFound.description -->
|
|
230
|
+
|
|
231
|
+
<!-- UTSAPIJSON.offBluetoothDeviceFound.compatibility -->
|
|
232
|
+
|
|
233
|
+
<!-- UTSAPIJSON.offBluetoothDeviceFound.param -->
|
|
234
|
+
|
|
235
|
+
<!-- UTSAPIJSON.offBluetoothDeviceFound.fileFormats -->
|
|
236
|
+
|
|
237
|
+
<!-- UTSAPIJSON.offBluetoothDeviceFound.returnValue -->
|
|
238
|
+
|
|
239
|
+
<!-- UTSAPIJSON.offBluetoothDeviceFound.example -->
|
|
240
|
+
|
|
241
|
+
<!-- UTSAPIJSON.offBluetoothDeviceFound.tutorial -->
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
<!-- UTSAPIJSON.getBluetoothDevices.name -->
|
|
245
|
+
|
|
246
|
+
<!-- UTSAPIJSON.getBluetoothDevices.description -->
|
|
247
|
+
|
|
248
|
+
<!-- UTSAPIJSON.getBluetoothDevices.compatibility -->
|
|
249
|
+
|
|
250
|
+
<!-- UTSAPIJSON.getBluetoothDevices.param -->
|
|
251
|
+
|
|
252
|
+
<!-- UTSAPIJSON.getBluetoothDevices.fileFormats -->
|
|
253
|
+
|
|
254
|
+
<!-- UTSAPIJSON.getBluetoothDevices.returnValue -->
|
|
255
|
+
|
|
256
|
+
<!-- UTSAPIJSON.getBluetoothDevices.example -->
|
|
257
|
+
|
|
258
|
+
<!-- UTSAPIJSON.getBluetoothDevices.tutorial -->
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
<!-- UTSAPIJSON.getConnectedBluetoothDevices.name -->
|
|
262
|
+
|
|
263
|
+
<!-- UTSAPIJSON.getConnectedBluetoothDevices.description -->
|
|
264
|
+
|
|
265
|
+
<!-- UTSAPIJSON.getConnectedBluetoothDevices.compatibility -->
|
|
266
|
+
|
|
267
|
+
<!-- UTSAPIJSON.getConnectedBluetoothDevices.param -->
|
|
268
|
+
|
|
269
|
+
<!-- UTSAPIJSON.getConnectedBluetoothDevices.fileFormats -->
|
|
270
|
+
|
|
271
|
+
<!-- UTSAPIJSON.getConnectedBluetoothDevices.returnValue -->
|
|
272
|
+
|
|
273
|
+
<!-- UTSAPIJSON.getConnectedBluetoothDevices.example -->
|
|
274
|
+
|
|
275
|
+
<!-- UTSAPIJSON.getConnectedBluetoothDevices.tutorial -->
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
<!-- UTSAPIJSON.general_type.name -->
|
|
279
|
+
|
|
280
|
+
<!-- UTSAPIJSON.general_type.param -->
|
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
::: warning 注意事项
|
|
2
|
+
|
|
3
|
+
使用前,需先按[蓝牙-通用](./bluetooth-general.md)中的流程初始化适配器并发现目标设备。建立连接后,先发现服务和特征值,再进行读写或开启通知;断开连接后需重新连接并重新发现服务与特征值。
|
|
4
|
+
|
|
5
|
+
:::
|
|
6
|
+
|
|
7
|
+
## 模块介绍
|
|
8
|
+
|
|
9
|
+
蓝牙低功耗(BLE)中心设备相关接口,用于与蓝牙设备建立连接、发现其服务与特征值,并对特征值进行读写、订阅通知等操作。
|
|
10
|
+
|
|
11
|
+
- **服务**:设备对外提供的一组功能,由 UUID 标识,可包含一个或多个特征值;
|
|
12
|
+
- **特征值**:服务下的数据点,由 UUID 标识,其 `properties` 描述支持的操作,如 read、write、notify、indicate 等;
|
|
13
|
+
- **UUID**:用于标识服务和特征值。调用接口时,使用 uni.getBLEDeviceServices 和 uni.getBLEDeviceCharacteristics 返回的 UUID。
|
|
14
|
+
|
|
15
|
+
本文负责连接与数据通信,[蓝牙-通用](./bluetooth-general.md)负责适配器管理与设备发现。各接口及参数的支持范围以对应的兼容性表为准。
|
|
16
|
+
|
|
17
|
+
## 使用流程
|
|
18
|
+
|
|
19
|
+
<a href="../static/bluetooth-le-central-flow.svg" target="_blank" rel="noopener"><img src="../static/bluetooth-le-central-flow.svg" alt="BLE 中心设备流程:连接设备、发现服务和特征值、按属性收发数据并清理连接" width="400"></a>
|
|
20
|
+
|
|
21
|
+
1. 注册 [uni.onBLEConnectionStateChange](#onbleconnectionstatechange) 和 [uni.onBLECharacteristicValueChange](#onblecharacteristicvaluechange),分别接收连接状态变化和特征值数据。
|
|
22
|
+
2. 使用扫描返回的 `deviceId`,调用 [uni.createBLEConnection](#createbleconnection) 连接目标设备。
|
|
23
|
+
3. 连接成功后,调用 [uni.getBLEDeviceServices](#getbledeviceservices) 发现服务,再调用 [uni.getBLEDeviceCharacteristics](#getbledevicecharacteristics) 获取目标服务的特征值及其属性。
|
|
24
|
+
4. 按特征值属性调用 [uni.readBLECharacteristicValue](#readblecharacteristicvalue) 或 [uni.writeBLECharacteristicValue](#writeblecharacteristicvalue)。调用 `readBLECharacteristicValue` 前需先注册 `onBLECharacteristicValueChange`,读取结果通过该事件的 `value` 返回;读取不要求先开启通知。
|
|
25
|
+
5. 如需接收外设主动发送的数据,调用 [uni.notifyBLECharacteristicValueChange](#notifyblecharacteristicvaluechange) 开启通知,通过已注册的特征值变化事件监听接收数据。
|
|
26
|
+
6. 按需调用 [uni.getBLEDeviceRSSI](#getbledevicerssi) 获取信号强度;iOS 写入长度与 MTU 的说明见 [uni.getBLEMTU](#getblemtu) 和 [uni.setBLEMTU](#setblemtu)。
|
|
27
|
+
7. 不再需要通知时将其关闭;通信结束后调用 [uni.closeBLEConnection](#closebleconnection),并移除当前页面或组件注册的事件监听。
|
|
28
|
+
|
|
29
|
+
## 权限@permission
|
|
30
|
+
|
|
31
|
+
蓝牙权限与[蓝牙-通用](./bluetooth-general.md#permission)一致,请先按该页完成各端权限配置。
|
|
32
|
+
|
|
33
|
+
## 注意事项@tips
|
|
34
|
+
|
|
35
|
+
### 通用
|
|
36
|
+
|
|
37
|
+
- **以特征值属性为准**:读、写和通知分别要求特征值支持对应的操作;支持读取不代表支持通知或写入。
|
|
38
|
+
- **重新连接后重新发现**:断线重连后,应重新获取服务与特征值,并按需开启通知,不要直接沿用上次连接的结果。
|
|
39
|
+
- **区分通知与事件监听**:关闭外设通知需调用 `notifyBLECharacteristicValueChange` 并传入 `state: false`;`offBLECharacteristicValueChange` 只移除事件监听,不能代替关闭通知。
|
|
40
|
+
- **按监听所属范围清理**:不再使用时移除自身注册的特征值和连接状态监听。当前 iOS 插件可保存 `on*` 返回的监听 ID,并将该 ID 传给对应的 `off*`,避免清空其他页面的监听。
|
|
41
|
+
- **控制写入长度与时序**:单次写入长度由平台和当前连接决定,超长数据需由业务分包;同一连接上的读写与通知配置操作宜按完成回调依次执行。
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
<!-- UTSAPIJSON.createBLEConnection.name -->
|
|
45
|
+
|
|
46
|
+
<!-- UTSAPIJSON.createBLEConnection.description -->
|
|
47
|
+
|
|
48
|
+
<!-- UTSAPIJSON.createBLEConnection.compatibility -->
|
|
49
|
+
|
|
50
|
+
<!-- UTSAPIJSON.createBLEConnection.param -->
|
|
51
|
+
|
|
52
|
+
<!-- UTSAPIJSON.createBLEConnection.fileFormats -->
|
|
53
|
+
|
|
54
|
+
<!-- UTSAPIJSON.createBLEConnection.returnValue -->
|
|
55
|
+
|
|
56
|
+
<!-- UTSAPIJSON.createBLEConnection.example -->
|
|
57
|
+
|
|
58
|
+
<!-- UTSAPIJSON.createBLEConnection.tutorial -->
|
|
59
|
+
|
|
60
|
+
### iOS 使用说明
|
|
61
|
+
|
|
62
|
+
- 先初始化适配器并扫描到目标设备,再传入扫描返回的 `deviceId`。能扫描到设备只表示收到了广播,不保证外设当前接受连接。
|
|
63
|
+
- 先注册 `onBLEConnectionStateChange`,再发起连接。同一设备不要并行调用多次 `createBLEConnection`,避免重复连接导致失败。
|
|
64
|
+
- 在 `success` 回调后调用 `getBLEDeviceServices` 和 `getBLEDeviceCharacteristics`,再开始读写或开启通知。连接成功不代表服务发现、特征值发现或业务认证已完成。
|
|
65
|
+
- `timeout` 的单位是毫秒,应设置为大于 0 的数值,并结合真机耗时确定。当前 iOS 插件不传时不设置连接超时期限,但仍可能因系统报告失败或适配器状态变化而结束。
|
|
66
|
+
- 当前 iOS 插件对已经连接的设备再次调用连接会返回成功。
|
|
67
|
+
|
|
68
|
+
### iOS 连接失败与超时排查 @ios-connection-troubleshooting
|
|
69
|
+
|
|
70
|
+
`createBLEConnection` 失败时,先确认适配器已初始化且可用,并使用扫描返回的 `deviceId`。连接成功后的服务发现、读写和通知问题,应按对应接口排查。
|
|
71
|
+
|
|
72
|
+
连接超时表示未在指定时间内完成连接,不代表设备已关机或停止广播;等待上一次断开完成也可能超时。能扫描到设备,不代表设备当前接受连接。
|
|
73
|
+
|
|
74
|
+
可按以下方向排查:
|
|
75
|
+
|
|
76
|
+
| 可能原因 | 检查与处理方式 |
|
|
77
|
+
| --- | --- |
|
|
78
|
+
| 信号弱或干扰 | 靠近外设,在干扰较少的环境中重试。 |
|
|
79
|
+
| 外设被占用或不可连接 | 断开其他手机、App 或调试工具的连接,确认外设处于可连接模式。 |
|
|
80
|
+
| 重复连接或断开未完成 | 同一设备只保留一个连接流程,避免并行连接或立即反复重连。 |
|
|
81
|
+
| 超时时间过短 | 结合正常连接耗时,适当增加 `timeout` 后对比。 |
|
|
82
|
+
| 外设重启或配对信息变化 | 重新扫描;若提示配对异常,按设备说明重新配对。持续失败时检查外设日志。 |
|
|
83
|
+
| 连接过多或系统暂不可用 | 关闭不必要的连接和扫描,通过 `onBluetoothAdapterStateChange` 确认可用后再试。 |
|
|
84
|
+
|
|
85
|
+
重试应设置间隔和次数上限,持续失败时提示用户检查设备。重连成功后,需重新发现服务和特征值,并按需开启通知。仍无法定位时,可按[调试建议](#调试建议)使用蓝牙工具对照验证。
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
<!-- UTSAPIJSON.closeBLEConnection.name -->
|
|
89
|
+
|
|
90
|
+
<!-- UTSAPIJSON.closeBLEConnection.description -->
|
|
91
|
+
|
|
92
|
+
<!-- UTSAPIJSON.closeBLEConnection.compatibility -->
|
|
93
|
+
|
|
94
|
+
<!-- UTSAPIJSON.closeBLEConnection.param -->
|
|
95
|
+
|
|
96
|
+
<!-- UTSAPIJSON.closeBLEConnection.fileFormats -->
|
|
97
|
+
|
|
98
|
+
<!-- UTSAPIJSON.closeBLEConnection.returnValue -->
|
|
99
|
+
|
|
100
|
+
<!-- UTSAPIJSON.closeBLEConnection.example -->
|
|
101
|
+
|
|
102
|
+
<!-- UTSAPIJSON.closeBLEConnection.tutorial -->
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
<!-- UTSAPIJSON.onBLEConnectionStateChange.name -->
|
|
106
|
+
|
|
107
|
+
<!-- UTSAPIJSON.onBLEConnectionStateChange.description -->
|
|
108
|
+
|
|
109
|
+
<!-- UTSAPIJSON.onBLEConnectionStateChange.compatibility -->
|
|
110
|
+
|
|
111
|
+
<!-- UTSAPIJSON.onBLEConnectionStateChange.param -->
|
|
112
|
+
|
|
113
|
+
<!-- UTSAPIJSON.onBLEConnectionStateChange.fileFormats -->
|
|
114
|
+
|
|
115
|
+
<!-- UTSAPIJSON.onBLEConnectionStateChange.returnValue -->
|
|
116
|
+
|
|
117
|
+
<!-- UTSAPIJSON.onBLEConnectionStateChange.example -->
|
|
118
|
+
|
|
119
|
+
<!-- UTSAPIJSON.onBLEConnectionStateChange.tutorial -->
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
<!-- UTSAPIJSON.offBLEConnectionStateChange.name -->
|
|
123
|
+
|
|
124
|
+
<!-- UTSAPIJSON.offBLEConnectionStateChange.description -->
|
|
125
|
+
|
|
126
|
+
<!-- UTSAPIJSON.offBLEConnectionStateChange.compatibility -->
|
|
127
|
+
|
|
128
|
+
<!-- UTSAPIJSON.offBLEConnectionStateChange.param -->
|
|
129
|
+
|
|
130
|
+
<!-- UTSAPIJSON.offBLEConnectionStateChange.fileFormats -->
|
|
131
|
+
|
|
132
|
+
<!-- UTSAPIJSON.offBLEConnectionStateChange.returnValue -->
|
|
133
|
+
|
|
134
|
+
<!-- UTSAPIJSON.offBLEConnectionStateChange.example -->
|
|
135
|
+
|
|
136
|
+
<!-- UTSAPIJSON.offBLEConnectionStateChange.tutorial -->
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
<!-- UTSAPIJSON.getBLEDeviceRSSI.name -->
|
|
140
|
+
|
|
141
|
+
<!-- UTSAPIJSON.getBLEDeviceRSSI.description -->
|
|
142
|
+
|
|
143
|
+
<!-- UTSAPIJSON.getBLEDeviceRSSI.compatibility -->
|
|
144
|
+
|
|
145
|
+
<!-- UTSAPIJSON.getBLEDeviceRSSI.param -->
|
|
146
|
+
|
|
147
|
+
<!-- UTSAPIJSON.getBLEDeviceRSSI.fileFormats -->
|
|
148
|
+
|
|
149
|
+
<!-- UTSAPIJSON.getBLEDeviceRSSI.returnValue -->
|
|
150
|
+
|
|
151
|
+
<!-- UTSAPIJSON.getBLEDeviceRSSI.example -->
|
|
152
|
+
|
|
153
|
+
<!-- UTSAPIJSON.getBLEDeviceRSSI.tutorial -->
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
<!-- UTSAPIJSON.getBLEMTU.name -->
|
|
157
|
+
|
|
158
|
+
<!-- UTSAPIJSON.getBLEMTU.description -->
|
|
159
|
+
|
|
160
|
+
<!-- UTSAPIJSON.getBLEMTU.compatibility -->
|
|
161
|
+
|
|
162
|
+
<!-- UTSAPIJSON.getBLEMTU.param -->
|
|
163
|
+
|
|
164
|
+
<!-- UTSAPIJSON.getBLEMTU.fileFormats -->
|
|
165
|
+
|
|
166
|
+
<!-- UTSAPIJSON.getBLEMTU.returnValue -->
|
|
167
|
+
|
|
168
|
+
<!-- UTSAPIJSON.getBLEMTU.example -->
|
|
169
|
+
|
|
170
|
+
<!-- UTSAPIJSON.getBLEMTU.tutorial -->
|
|
171
|
+
|
|
172
|
+
### iOS 注意事项
|
|
173
|
+
|
|
174
|
+
- 当前 iOS 插件返回的 `mtu` 是指定 `writeType` 对应的最大可写数据长度,单位为字节,不是 ATT MTU;不传 `writeType` 时按 `write` 查询。
|
|
175
|
+
- 直接以返回值作为该写模式的单次写入长度上限,无需再减 3,也不能通过加 3 推算 ATT MTU。查询时的 `writeType` 应与实际写入时一致。
|
|
176
|
+
- 返回的长度上限不代表外设业务协议支持任意长度的数据,分包还需遵循设备协议。
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
<!-- UTSAPIJSON.setBLEMTU.name -->
|
|
180
|
+
|
|
181
|
+
<!-- UTSAPIJSON.setBLEMTU.description -->
|
|
182
|
+
|
|
183
|
+
<!-- UTSAPIJSON.setBLEMTU.compatibility -->
|
|
184
|
+
|
|
185
|
+
<!-- UTSAPIJSON.setBLEMTU.param -->
|
|
186
|
+
|
|
187
|
+
<!-- UTSAPIJSON.setBLEMTU.fileFormats -->
|
|
188
|
+
|
|
189
|
+
<!-- UTSAPIJSON.setBLEMTU.returnValue -->
|
|
190
|
+
|
|
191
|
+
<!-- UTSAPIJSON.setBLEMTU.example -->
|
|
192
|
+
|
|
193
|
+
<!-- UTSAPIJSON.setBLEMTU.tutorial -->
|
|
194
|
+
|
|
195
|
+
### iOS 注意事项
|
|
196
|
+
|
|
197
|
+
iOS 不支持主动设置 MTU,当前插件调用此接口会执行 `fail` 和 `complete`,返回不支持错误。写入前可通过 `getBLEMTU` 查询对应写模式的最大可写长度。
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
<!-- UTSAPIJSON.onBLEMTUChange.name -->
|
|
201
|
+
|
|
202
|
+
<!-- UTSAPIJSON.onBLEMTUChange.description -->
|
|
203
|
+
|
|
204
|
+
<!-- UTSAPIJSON.onBLEMTUChange.compatibility -->
|
|
205
|
+
|
|
206
|
+
<!-- UTSAPIJSON.onBLEMTUChange.param -->
|
|
207
|
+
|
|
208
|
+
<!-- UTSAPIJSON.onBLEMTUChange.fileFormats -->
|
|
209
|
+
|
|
210
|
+
<!-- UTSAPIJSON.onBLEMTUChange.returnValue -->
|
|
211
|
+
|
|
212
|
+
<!-- UTSAPIJSON.onBLEMTUChange.example -->
|
|
213
|
+
|
|
214
|
+
<!-- UTSAPIJSON.onBLEMTUChange.tutorial -->
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
<!-- UTSAPIJSON.offBLEMTUChange.name -->
|
|
218
|
+
|
|
219
|
+
<!-- UTSAPIJSON.offBLEMTUChange.description -->
|
|
220
|
+
|
|
221
|
+
<!-- UTSAPIJSON.offBLEMTUChange.compatibility -->
|
|
222
|
+
|
|
223
|
+
<!-- UTSAPIJSON.offBLEMTUChange.param -->
|
|
224
|
+
|
|
225
|
+
<!-- UTSAPIJSON.offBLEMTUChange.fileFormats -->
|
|
226
|
+
|
|
227
|
+
<!-- UTSAPIJSON.offBLEMTUChange.returnValue -->
|
|
228
|
+
|
|
229
|
+
<!-- UTSAPIJSON.offBLEMTUChange.example -->
|
|
230
|
+
|
|
231
|
+
<!-- UTSAPIJSON.offBLEMTUChange.tutorial -->
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
<!-- UTSAPIJSON.getBLEDeviceServices.name -->
|
|
235
|
+
|
|
236
|
+
<!-- UTSAPIJSON.getBLEDeviceServices.description -->
|
|
237
|
+
|
|
238
|
+
<!-- UTSAPIJSON.getBLEDeviceServices.compatibility -->
|
|
239
|
+
|
|
240
|
+
<!-- UTSAPIJSON.getBLEDeviceServices.param -->
|
|
241
|
+
|
|
242
|
+
<!-- UTSAPIJSON.getBLEDeviceServices.fileFormats -->
|
|
243
|
+
|
|
244
|
+
<!-- UTSAPIJSON.getBLEDeviceServices.returnValue -->
|
|
245
|
+
|
|
246
|
+
<!-- UTSAPIJSON.getBLEDeviceServices.example -->
|
|
247
|
+
|
|
248
|
+
<!-- UTSAPIJSON.getBLEDeviceServices.tutorial -->
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
<!-- UTSAPIJSON.getBLEDeviceCharacteristics.name -->
|
|
252
|
+
|
|
253
|
+
<!-- UTSAPIJSON.getBLEDeviceCharacteristics.description -->
|
|
254
|
+
|
|
255
|
+
<!-- UTSAPIJSON.getBLEDeviceCharacteristics.compatibility -->
|
|
256
|
+
|
|
257
|
+
<!-- UTSAPIJSON.getBLEDeviceCharacteristics.param -->
|
|
258
|
+
|
|
259
|
+
<!-- UTSAPIJSON.getBLEDeviceCharacteristics.fileFormats -->
|
|
260
|
+
|
|
261
|
+
<!-- UTSAPIJSON.getBLEDeviceCharacteristics.returnValue -->
|
|
262
|
+
|
|
263
|
+
<!-- UTSAPIJSON.getBLEDeviceCharacteristics.example -->
|
|
264
|
+
|
|
265
|
+
<!-- UTSAPIJSON.getBLEDeviceCharacteristics.tutorial -->
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
<!-- UTSAPIJSON.readBLECharacteristicValue.name -->
|
|
269
|
+
|
|
270
|
+
<!-- UTSAPIJSON.readBLECharacteristicValue.description -->
|
|
271
|
+
|
|
272
|
+
<!-- UTSAPIJSON.readBLECharacteristicValue.compatibility -->
|
|
273
|
+
|
|
274
|
+
<!-- UTSAPIJSON.readBLECharacteristicValue.param -->
|
|
275
|
+
|
|
276
|
+
<!-- UTSAPIJSON.readBLECharacteristicValue.fileFormats -->
|
|
277
|
+
|
|
278
|
+
<!-- UTSAPIJSON.readBLECharacteristicValue.returnValue -->
|
|
279
|
+
|
|
280
|
+
<!-- UTSAPIJSON.readBLECharacteristicValue.example -->
|
|
281
|
+
|
|
282
|
+
<!-- UTSAPIJSON.readBLECharacteristicValue.tutorial -->
|
|
283
|
+
|
|
284
|
+
### 注意事项
|
|
285
|
+
|
|
286
|
+
- 先注册 `onBLECharacteristicValueChange`,再发起读取。读取结果通过该事件的 `value` 返回,`readBLECharacteristicValue` 的成功回调不包含特征值数据。
|
|
287
|
+
- 主动读取要求特征值支持 `read`,无需先调用 `notifyBLECharacteristicValueChange` 开启通知。
|
|
288
|
+
- 多设备或多特征值共用事件监听时,应按事件中的 `deviceId`、`serviceId` 和 `characteristicId` 匹配数据来源。
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
<!-- UTSAPIJSON.writeBLECharacteristicValue.name -->
|
|
292
|
+
|
|
293
|
+
<!-- UTSAPIJSON.writeBLECharacteristicValue.description -->
|
|
294
|
+
|
|
295
|
+
<!-- UTSAPIJSON.writeBLECharacteristicValue.compatibility -->
|
|
296
|
+
|
|
297
|
+
<!-- UTSAPIJSON.writeBLECharacteristicValue.param -->
|
|
298
|
+
|
|
299
|
+
<!-- UTSAPIJSON.writeBLECharacteristicValue.fileFormats -->
|
|
300
|
+
|
|
301
|
+
<!-- UTSAPIJSON.writeBLECharacteristicValue.returnValue -->
|
|
302
|
+
|
|
303
|
+
<!-- UTSAPIJSON.writeBLECharacteristicValue.example -->
|
|
304
|
+
|
|
305
|
+
<!-- UTSAPIJSON.writeBLECharacteristicValue.tutorial -->
|
|
306
|
+
|
|
307
|
+
### 注意事项
|
|
308
|
+
|
|
309
|
+
- 应根据特征值属性选择 `writeType`:`write` 为有响应写,`writeNoResponse` 为无响应写。当前 iOS 插件不传时使用 `write`,不会因特征值只支持无响应写而自动切换;此时需显式传入 `writeNoResponse`。
|
|
310
|
+
- 当前 iOS 插件不会自动分包。超过单次写入长度上限时,会调用 `fail` 和 `complete`,需按长度上限与设备协议自行分包,详见 [getBLEMTU 的 iOS 注意事项](#getblemtu)。
|
|
311
|
+
- 无响应写缺少外设对本次写入的协议层确认。若业务需要确认设备已接收或处理数据,应设计应用层应答机制。
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
<!-- UTSAPIJSON.notifyBLECharacteristicValueChange.name -->
|
|
315
|
+
|
|
316
|
+
<!-- UTSAPIJSON.notifyBLECharacteristicValueChange.description -->
|
|
317
|
+
|
|
318
|
+
<!-- UTSAPIJSON.notifyBLECharacteristicValueChange.compatibility -->
|
|
319
|
+
|
|
320
|
+
<!-- UTSAPIJSON.notifyBLECharacteristicValueChange.param -->
|
|
321
|
+
|
|
322
|
+
<!-- UTSAPIJSON.notifyBLECharacteristicValueChange.fileFormats -->
|
|
323
|
+
|
|
324
|
+
<!-- UTSAPIJSON.notifyBLECharacteristicValueChange.returnValue -->
|
|
325
|
+
|
|
326
|
+
<!-- UTSAPIJSON.notifyBLECharacteristicValueChange.example -->
|
|
327
|
+
|
|
328
|
+
<!-- UTSAPIJSON.notifyBLECharacteristicValueChange.tutorial -->
|
|
329
|
+
|
|
330
|
+
### 注意事项
|
|
331
|
+
|
|
332
|
+
- 先注册 `onBLECharacteristicValueChange`,再传入 `state: true` 开启通知;特征值需支持 `notify` 或 `indicate`。
|
|
333
|
+
- 开启成功表示通知配置完成,不代表外设会立即发送数据;是否上报、何时上报由设备协议决定。
|
|
334
|
+
- 不再需要通知时传入 `state: false`。断线重连后如需继续接收通知,应重新发现服务和特征值并再次开启通知。
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
<!-- UTSAPIJSON.onBLECharacteristicValueChange.name -->
|
|
338
|
+
|
|
339
|
+
<!-- UTSAPIJSON.onBLECharacteristicValueChange.description -->
|
|
340
|
+
|
|
341
|
+
<!-- UTSAPIJSON.onBLECharacteristicValueChange.compatibility -->
|
|
342
|
+
|
|
343
|
+
<!-- UTSAPIJSON.onBLECharacteristicValueChange.param -->
|
|
344
|
+
|
|
345
|
+
<!-- UTSAPIJSON.onBLECharacteristicValueChange.fileFormats -->
|
|
346
|
+
|
|
347
|
+
<!-- UTSAPIJSON.onBLECharacteristicValueChange.returnValue -->
|
|
348
|
+
|
|
349
|
+
<!-- UTSAPIJSON.onBLECharacteristicValueChange.example -->
|
|
350
|
+
|
|
351
|
+
<!-- UTSAPIJSON.onBLECharacteristicValueChange.tutorial -->
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
<!-- UTSAPIJSON.offBLECharacteristicValueChange.name -->
|
|
355
|
+
|
|
356
|
+
<!-- UTSAPIJSON.offBLECharacteristicValueChange.description -->
|
|
357
|
+
|
|
358
|
+
<!-- UTSAPIJSON.offBLECharacteristicValueChange.compatibility -->
|
|
359
|
+
|
|
360
|
+
<!-- UTSAPIJSON.offBLECharacteristicValueChange.param -->
|
|
361
|
+
|
|
362
|
+
<!-- UTSAPIJSON.offBLECharacteristicValueChange.fileFormats -->
|
|
363
|
+
|
|
364
|
+
<!-- UTSAPIJSON.offBLECharacteristicValueChange.returnValue -->
|
|
365
|
+
|
|
366
|
+
<!-- UTSAPIJSON.offBLECharacteristicValueChange.example -->
|
|
367
|
+
|
|
368
|
+
<!-- UTSAPIJSON.offBLECharacteristicValueChange.tutorial -->
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
<!-- UTSAPIJSON.ble.example -->
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
<!-- UTSAPIJSON.general_type.name -->
|
|
375
|
+
|
|
376
|
+
<!-- UTSAPIJSON.general_type.param -->
|