Watchface

Sets watchface index

The watch supports a variety of different watchfaces, which can be switched freely.

Send watchface type,Parameters provided by WatchFaceType.

_blePlugin.sendDisplayWatchFace(WatchFaceType);

WatchFaceType:

valuevalue typevalue description
firstWatchFaceint0x01
secondWatchFaceint0x02
thirdWatchFaceint0x03

Gets the watchface

Gets the watchface being displayed.

int watchFace = await _blePlugin.queryDisplayWatchFace;

Gets the watchface layout

WatchFaceLayoutBean info = await _blePlugin.queryWatchFaceLayout;

Parameter Description :

WatchFaceLayoutBean:

valuevalue typevalue description
backgroundPictureMd5StringThe background image MD5 has a length of 32 bits. When padded with 0, the background image restores the default background.
compressionTypeStringThe compression type(LZO,RGB_DEDUPLICATION,RGB_LINE, ORIGINAL)
heightintThe watch face height default 240 px.
textColorintfont color(RGB)
thumHeightintThe thum watch face height,The default is 0, which means it is not supported
thumWidthintThe thum watch face width,The default is 0, which means it is not supported
timeBottomContentintcontent displayed
timePositioninttime position
timeTopContentintcontent
widthintThe watch face width default 240 px.

WatchFaceLayoutType:

valuevalue typevalue description
watchFaceTimeTopintTime is at the top right
watchFaceTimeBottomintTime is at the bottom right
watchFaceContentcloseintDo not display anything
watchFaceContentDateintDate
watchFaceContentSleepintSleep
watchFaceContentHeartRateintHeart Rate
watchFaceContentStepintSteps

Sets the watchface layout

_blePlugin.sendWatchFaceLayout(WatchFaceLayoutBean info);

Sets watchface background Listener

Sets up a watchface background transmission monitor fileTransEveStm, and save the returned value in "event" with the value of the FileTransBean object.

_blePlugin.fileTransEveStm.listen(
      (FileTransBean event) {
       /// Do something with new state,for example:
        setState(() {
          switch (event.type) {
            case TransType.transStart:
              break;
            case TransType.transChanged:
              _progress = event.progress!;
              break;
            case TransType.transCompleted:
              break;
            case TransType.error:
              _error = event.error!;
              break;
            default:
              break;
          }
        });
      },
    );

Callback Description(event):

FileTransBean:

callback valuecallback value typecallback value description
typeintWeather change return value type, the type is TransType
isErrorboolDetermine whether the dial background transmission is wrong
progressintDial background transfer progress

TransType:

typevaluevalue description
transStart1Indicates that the dial background is obtained and the data returned by the monitor is transmitted
transChanged2Retrieves the data returned by the dial background transmission monitor
transCompleted3It means to obtain the data returned by monitoring the dial background after transmission
error4Indicates dial background transmission error listening for returned data

Sets the watchface background

The dial of the 1.3-inch color screen supports the replacement of the background image with a picture size of 240 * 240 px. Compressed indicates whether the picture needs to be compressed (the watch with the master control of 52840 does not support compression and is fixed to false); timeout indicates the timeout period, in seconds. The progress is called back by _blePlugin.fileTransEveStm.listen.

_blePlugin.sendWatchFaceBackground(WatchFaceBackgroundBean info);

Parameter Description :

WatchFaceBackgroundBean:

callback valuecallback value typecallback value description
bitmapUint8ListThe bitmap of background image
thumbBitmapUint8ListThe bitmap of thumbnail
typeStringWatchFaceLayoutBean.WatchFaceLayoutType
thumbWidthintwidth of thumbBitmap
thumbHeightintheight of thumbBitmap
widthintwidth of bitmap
heightintheight of bitmap

Gets support watchface type

When the watch switches dials, it needs to query the type supported by the dial.

SupportWatchFaceBean info = await _blePlugin.querySupportWatchFace;

callback description:

SupportWatchFaceBean:

displayWatchFacesupportWatchFaceList
The currently displayed dial numberTypes of watch faces

Gets the watchface store

According to the watchface type supported by the watch, obtain a list of watchfaces that the watch can be replaced.

Gets the list of available watch faces by way of paging query.

List<WatchFaceBean> listInfo= await _blePlugin.queryWatchFaceStore(WatchFaceStoreBean);

WatchFaceStoreBean :

valuevalue typevalue description
watchFaceSupportListList< int >watchface support type
firmwareVersionStringDial firmware version number
pageCountintNumber of watch faces per page
pageIndexintcurrent page number

Precautions:

watchFaceSupportList:parameters are obtained by the _blePlugin.querySupportWatchFace.

firmwareVersion:Get the firmware version number through _blePlugin.queryFirmwareVersion.

Gets the watchface information of the watchface id

WatchFaceIdBean info = await _blePlugin.queryWatchFaceOfID(id);

Parameter Description :

WatchFaceIdBean:

valuevalue typevalue description
idintThe information of the dial is obtained by the id of the dial, and the parameters are obtained by the _blePlugin.queryDisplayWatchFace

callback description:

WatchFaceIdBean:

callback valuecallback value typecallback value description
watchFaceWatchFacewatch face file
errorStringerror message
codeintreturn code

WatchFace:

valuevalue typevalue description
idintfile id
previewStringWatchface Image preview link
fileStringWatchface file download link

Sets watchface file listener

      _blePlugin.wfFileTransEveStm.listen(
        (FileTransBean event) {
          /// Do something with new state,for example:
          setState(() {
            switch (event.type) {
              case TransType.transStart:
                break;
              case TransType.transChanged:
                _progress = event.progress!;
                break;
              case TransType.transCompleted:
                _progress = event.progress!;
                break;
              case TransType.error:
                _error = event.error!;
                break;
              default:
                break;
            }
          });
        },
      ),

Callback Description(event):

FileTransBean:

callback valuecallback value typecallback value description
typeintWeather change return value type, the type is TransType
isErrorboolCheck whether the dial file transfer is incorrect
progressintDial file transfer progress

TransType:

typevaluevalue description
transStart1Retrieves the dial file and begins transmitting the data returned by the listener
transChanged2Retrieves the data returned by the dial file transfer listener
transCompleted3Indicates that the data returned after the dial file transfer is completed
error4Indicates a dial file transfer error listening for returned data

Sets a watchface file

Send the watchface file of the new watchface to the watch, during which the watch will restart.

_blePlugin.sendWatchFace(SendWatchFaceBean bean);

Parameter Description :

SendWatchFaceBean:

valuevalue typevalue description
watchFaceFlutterBeanCustomizeWatchFaceBeanDial file information
timeoutintThe dial file transfer timed out

CustomizeWatchFaceBean:

valuevalue typevalue description
indexintfile id
fileStringThe address where the watch face file is stored
Last Updated: