wxs-chris-wxsnetwork
v1.0.6
Published
WXS Network
Downloads
191
Readme
WXS Network
Install
npm install wxs-chris-wxsnetwork
npx cap syncPlatform Specific Configurations
iOS
- After build follow step mention in below image for avoid linking errors during build.
API
addListener('initCallback', ...)addListener('onScanResult', ...)addListener('onBleStateChange', ...)addListener('onAddDevice', ...)addListener('onReceiveWeightData', ...)addListener('onDeviceConnectionChanged', ...)addListener('onHrMeasureStart', ...)addListener('onHrMeasureOver', ...)addListener('onMeasureStart', ...)addListener('onMeasureEnd', ...)removeAllListeners()echo(...)initDeviceManager(...)startScan()addDevice(...)addDeviceUsingMacAddress(...)updateUserInfo(...)deInitDeviceManager()setUserInScaleDevice(...)isBluetoothEnabled()isLocationEnabled()checkLocationPermission()- Interfaces
addListener('initCallback', ...)
addListener(eventName: 'initCallback', listenerFunc: (data: { status: boolean; }) => void) => PluginListenerHandle| Param | Type |
| ------------------ | ---------------------------------------------------- |
| eventName | 'initCallback' |
| listenerFunc | (data: { status: boolean; }) => void |
Returns: PluginListenerHandle
addListener('onScanResult', ...)
addListener(eventName: 'onScanResult', listenerFunc: (data: ScanResult) => void) => PluginListenerHandle| Param | Type |
| ------------------ | -------------------------------------------------------------------- |
| eventName | 'onScanResult' |
| listenerFunc | (data: ScanResult) => void |
Returns: PluginListenerHandle
addListener('onBleStateChange', ...)
addListener(eventName: 'onBleStateChange', listenerFunc: (data: { ble_status: string; }) => void) => PluginListenerHandle| Param | Type |
| ------------------ | ------------------------------------------------------- |
| eventName | 'onBleStateChange' |
| listenerFunc | (data: { ble_status: string; }) => void |
Returns: PluginListenerHandle
addListener('onAddDevice', ...)
addListener(eventName: 'onAddDevice', listenerFunc: (data: { device: string; status: string; }) => void) => PluginListenerHandle| Param | Type |
| ------------------ | ------------------------------------------------------------------- |
| eventName | 'onAddDevice' |
| listenerFunc | (data: { device: string; status: string; }) => void |
Returns: PluginListenerHandle
addListener('onReceiveWeightData', ...)
addListener(eventName: 'onReceiveWeightData', listenerFunc: (data: { data: any; status: string; }) => void) => PluginListenerHandle| Param | Type |
| ------------------ | -------------------------------------------------------------- |
| eventName | 'onReceiveWeightData' |
| listenerFunc | (data: { data: any; status: string; }) => void |
Returns: PluginListenerHandle
addListener('onDeviceConnectionChanged', ...)
addListener(eventName: 'onDeviceConnectionChanged', listenerFunc: (data: { data: string; connection_state: string; }) => void) => PluginListenerHandle| Param | Type |
| ------------------ | --------------------------------------------------------------------------- |
| eventName | 'onDeviceConnectionChanged' |
| listenerFunc | (data: { data: string; connection_state: string; }) => void |
Returns: PluginListenerHandle
addListener('onHrMeasureStart', ...)
addListener(eventName: 'onHrMeasureStart', listenerFunc: () => void) => PluginListenerHandle| Param | Type |
| ------------------ | ------------------------------- |
| eventName | 'onHrMeasureStart' |
| listenerFunc | () => void |
Returns: PluginListenerHandle
addListener('onHrMeasureOver', ...)
addListener(eventName: 'onHrMeasureOver', listenerFunc: (data: { hr: any; }) => void) => PluginListenerHandle| Param | Type |
| ------------------ | -------------------------------------------- |
| eventName | 'onHrMeasureOver' |
| listenerFunc | (data: { hr: any; }) => void |
Returns: PluginListenerHandle
addListener('onMeasureStart', ...)
addListener(eventName: 'onMeasureStart', listenerFunc: () => void) => PluginListenerHandle| Param | Type |
| ------------------ | ----------------------------- |
| eventName | 'onMeasureStart' |
| listenerFunc | () => void |
Returns: PluginListenerHandle
addListener('onMeasureEnd', ...)
addListener(eventName: 'onMeasureEnd', listenerFunc: () => void) => PluginListenerHandle| Param | Type |
| ------------------ | --------------------------- |
| eventName | 'onMeasureEnd' |
| listenerFunc | () => void |
Returns: PluginListenerHandle
removeAllListeners()
removeAllListeners() => Promise<void>Remove all native listeners for this plugin
echo(...)
echo(options: { value: string; }) => Promise<{ value: string; }>| Param | Type |
| ------------- | ------------------------------- |
| options | { value: string; } |
Returns: Promise<{ value: string; }>
initDeviceManager(...)
initDeviceManager(options: InitDeviceOptions) => Promise<{ data: string; }>| Param | Type |
| ------------- | --------------------------------------------------------------- |
| options | InitDeviceOptions |
Returns: Promise<{ data: string; }>
startScan()
startScan() => Promise<{ status: string; }>Returns: Promise<{ status: string; }>
addDevice(...)
addDevice(options: { deviceIndex: number; }) => Promise<{ status: string; }>| Param | Type |
| ------------- | ------------------------------------- |
| options | { deviceIndex: number; } |
Returns: Promise<{ status: string; }>
addDeviceUsingMacAddress(...)
addDeviceUsingMacAddress(options: { macAddress: string; }) => Promise<{ status: string; }>| Param | Type |
| ------------- | ------------------------------------ |
| options | { macAddress: string; } |
Returns: Promise<{ status: string; }>
updateUserInfo(...)
updateUserInfo(options: UserInfo) => Promise<{ status: string; }>| Param | Type |
| ------------- | --------------------------------------------- |
| options | UserInfo |
Returns: Promise<{ status: string; }>
deInitDeviceManager()
deInitDeviceManager() => Promise<{ status: string; }>Returns: Promise<{ status: string; }>
setUserInScaleDevice(...)
setUserInScaleDevice(options: { userInfo: InitDeviceOptions[]; }) => Promise<{ status: boolean; }>| Param | Type |
| ------------- | ----------------------------------------------- |
| options | { userInfo: InitDeviceOptions[]; } |
Returns: Promise<{ status: boolean; }>
isBluetoothEnabled()
isBluetoothEnabled() => Promise<{ isEnabled: boolean; }>Only for android
Returns: Promise<{ isEnabled: boolean; }>
isLocationEnabled()
isLocationEnabled() => Promise<{ isEnabled: boolean; }>Returns: Promise<{ isEnabled: boolean; }>
checkLocationPermission()
checkLocationPermission() => Promise<{ isAllowed: boolean; }>Returns: Promise<{ isAllowed: boolean; }>
Interfaces
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove | () => Promise<void> |
ScanResult
| Prop | Type |
| --------------- | ------------------------- |
| scanFound | boolean |
| devices | DeviceInfo[] |
DeviceInfo
| Prop | Type |
| ---------------- | ------------------- |
| deviceName | string |
| device | string |
InitDeviceOptions
| Prop | Type |
| ------------------- | ---------------------------------- |
| age | number |
| height | number |
| gender | number |
| target_weight | number |
| weight | number |
| mode | 'athlete' | 'normal' |
UserInfo
| Prop | Type |
| -------------- | ------------------- |
| nickName | string |
