initDynamicLib static method

dynamic initDynamicLib(
  1. DynamicLibrary nativeLib
)

Implementation

static initDynamicLib(DynamicLibrary nativeLib) {
  slog('init dynamic lib');

  helloWorld = nativeLib.lookupFunction<Void Function(), void Function()>("helloWorld");
  helloWorld();

  clingNative.cwsEnableLog = nativeLib.lookupFunction<Void Function(Int), void Function(int)>("cwsEnableLog");
  clingNative.cwsRegister = nativeLib.lookupFunction<Int Function(Pointer<Utf8> appKey, Pointer<Utf8> appSecret, Pointer<SdkRegistration> args), int Function(Pointer<Utf8> appKey, Pointer<Utf8> appSecret, Pointer<SdkRegistration> args)>("cwsRegister");
  clingNative.cwsInit = nativeLib.lookupFunction<Void Function(), void Function()>("cwsInit");
  clingNative.cwsDeinit = nativeLib.lookupFunction<Void Function(), void Function()>("cwsDeinit");
  clingNative.cwsGetBindingState = nativeLib.lookupFunction<Int Function(), int Function()>("cwsGetBindingState");
  clingNative.cwsGgetRegisterationState = nativeLib.lookupFunction<Int Function(), int Function()>("cwsGgetRegisterationState");
  clingNative.cwsGetVirtualBindingInfo = nativeLib.lookupFunction<Void Function(Pointer<PERIPHERAL_ACCOUNT_BINDING_DATA> pBindingInfo), void Function(Pointer<PERIPHERAL_ACCOUNT_BINDING_DATA> pBindingInfo)> ("cwsGetVirtualBindingInfo");
  clingNative.cwsStartBinding = nativeLib.lookupFunction<Int Function(Pointer<PERIPHERAL_STREAMING_DATA>), int Function(Pointer<PERIPHERAL_STREAMING_DATA>)> ("cwsStartBinding");
  clingNative.cwsStartBindingWithUserId = nativeLib.lookupFunction<Int Function(Int userId), int Function(int userId)> ("cwsStartBindingWithUserId");
  clingNative.cwsFinishBinding = nativeLib.lookupFunction<Int Function(Pointer<Char> token), int Function(Pointer<Char>)> ("cwsFinishBinding");
  clingNative.cwsGetBondAccountUserID = nativeLib.lookupFunction<Long Function(), int Function()>("cwsGetBondAccountUserID");
  clingNative.cwsUnbindPeripheral = nativeLib.lookupFunction<Int Function(), int Function()>("cwsUnbindPeripheral");
  clingNative.cwsSetStreamingMode = nativeLib.lookupFunction<Void Function(Int bEnable), void Function(int bEnable)> ("cwsSetStreamingMode");
  clingNative.cwsSetSmartNotificationMode = nativeLib.lookupFunction<Void Function(Int bEnable), void Function(int bEnable)> ("cwsSetSmartNotificationMode");
  clingNative.cwsSetSimulationMode = nativeLib.lookupFunction<Void Function(Int bEnable), void Function(int bEnable)> ("cwsSetSimulationMode");
  clingNative.cwsSendEmptyCmd = nativeLib.lookupFunction<Void Function(Int cmd, Int bTestEn), void Function(int cmd, int bTestEn)> ("cwsSendEmptyCmd");
  clingNative.cwsSetUserReminder = nativeLib.lookupFunction<Void Function(Pointer<PERIPHERAL_USER_REMINDER_CONTEXT> pReminder, Int index, Int bUpdate), void Function(Pointer<PERIPHERAL_USER_REMINDER_CONTEXT> pReminder, int index, int bUpdate)> ("cwsSetUserReminder");
  clingNative.cwsSendUserReminder = nativeLib.lookupFunction<Void Function(), void Function()>("cwsSendUserReminder");
  clingNative.cwsSetGoGPSDownStreamData = nativeLib.lookupFunction<Void Function(Pointer<PERIPHERAL_GOGPS_DOWNDATA> pDowndata), void Function(Pointer<PERIPHERAL_GOGPS_DOWNDATA> pDowndata)> ("cwsSetGoGPSDownStreamData");
  clingNative.cwsSendGoGPSDownStreamData = nativeLib.lookupFunction<Void Function(), void Function()>("cwsSendGoGPSDownStreamData");
  clingNative.cwsSetGoGPSBloodPressureCalibration = nativeLib.lookupFunction<Void Function(Int bloodpressurehp, Int bloodpressurelp), void Function(int bloodpressurehp, int bloodpressurelp)> ("cwsSetGoGPSBloodPressureCalibration");
  clingNative.cwsSendGoGPSBloodPressureCalibration = nativeLib.lookupFunction<Void Function(), void Function()> ("cwsSendGoGPSBloodPressureCalibration");
  clingNative.cwsSetDailyClockReminder = nativeLib.lookupFunction<Void Function(Pointer<PERIPHERAL_DAILY_CLOCK_REMINDER_CONTEXT> pReminder), void Function(Pointer<PERIPHERAL_DAILY_CLOCK_REMINDER_CONTEXT>)> ("cwsSetDailyClockReminder");
  clingNative.cwsClearUserReminders = nativeLib.lookupFunction<Void Function(), void Function()>("cwsClearUserReminders");
  clingNative.cwsSetNewUserReminder = nativeLib.lookupFunction<Void Function(Pointer<PERIPHERAL_USER_REMINDER_CONTEXT> pReminder, Int index, Int bUpdate), void Function(Pointer<PERIPHERAL_USER_REMINDER_CONTEXT> pReminder, int index, int bUpdate)> ("cwsSetNewUserReminder");
  clingNative.cwsSendNewUserReminder = nativeLib.lookupFunction<Void Function(), void Function()>("cwsSendNewUserReminder");
  clingNative.cwsClearNewUserReminders = nativeLib.lookupFunction<Void Function(), void Function()>("cwsClearNewUserReminders");
  clingNative.cwsPeripheralConnect = nativeLib.lookupFunction<Void Function(), void Function()>("cwsPeripheralConnect");
  clingNative.cwsPeripheralDisconnect = nativeLib.lookupFunction<Void Function(), void Function()>("cwsPeripheralDisconnect");
  clingNative.cwsQueuePacket = nativeLib.lookupFunction<Void Function(Pointer<Void> arrayBody, Int length), void Function(Pointer<Void> arrayBody, int length)> ("cwsQueuePacket");
  clingNative.cwsStartOTA = nativeLib.lookupFunction<Void Function(), void Function()> ("cwsStartOTA");
  clingNative.cwsSetFirmwareUpgradeState = nativeLib.lookupFunction<Void Function(Int state), void Function(int state)> ("cwsSetFirmwareUpgradeState");
  clingNative.cwsGetFirmwareUpgradeState = nativeLib.lookupFunction<Int Function(), int Function()>("cwsGetFirmwareUpgradeState");
  clingNative.cwsFirmwareUpdateStateMachine = nativeLib.lookupFunction<Int Function(), int Function()> ("cwsFirmwareUpdateStateMachine");
  clingNative.cwsUpdatePeripheralFirmware = nativeLib.lookupFunction<Int Function(Pointer<Void> arrayBody, Int length), int Function(Pointer<Void> arrayBody, int length)> ("cwsUpdatePeripheralFirmware");
  clingNative.cwsSetFirmwareParams = nativeLib.lookupFunction<Int Function(Pointer<Void> arrayBody, Int length), int Function(Pointer<Void> arrayBody, int length)> ("cwsSetFirmwareParams");
  clingNative.cwsGetDeviceInfo = nativeLib.lookupFunction<Void Function(Pointer<PERIPHERAL_DEVICE_INFO_CONTEXT> pDevinfo), void Function(Pointer<PERIPHERAL_DEVICE_INFO_CONTEXT> pDevinfo)> ("cwsGetDeviceInfo");
  clingNative.cwsGetDailyActivityInfo = nativeLib.lookupFunction<Void Function(Pointer<PERIPHERAL_DAILY_ACTIVITY_INFO_CONTEXT> pDailyinfo), void Function(Pointer<PERIPHERAL_DAILY_ACTIVITY_INFO_CONTEXT> pDailyinfo)> ("cwsGetDailyActivityInfo");
  clingNative.cwsUpdateWeatherForecast = nativeLib.lookupFunction<Void Function(Pointer<PERIPHERAL_WEATHER_DATA> pWeather, Int index), void Function(Pointer<PERIPHERAL_WEATHER_DATA> pWeather, int index)> ("cwsUpdateWeatherForecast");
  clingNative.cwsSendWeather = nativeLib.lookupFunction<Void Function(), void Function()>("cwsSendWeather");
  clingNative.cwsUpdateArrowData = nativeLib.lookupFunction<Void Function(Pointer<PERIPHERAL_ARROW_DATA> pArrow), void Function(Pointer<PERIPHERAL_ARROW_DATA> pArrow)> ("cwsUpdateArrowData");
  clingNative.cwsSendArrowData = nativeLib.lookupFunction<Void Function(), void Function()>("cwsSendArrowData");
  clingNative.cwsUpdateRRIConfig = nativeLib.lookupFunction<Void Function(Pointer<PERIPHERAL_RRI_CONFIG> pRriconfig), void Function(Pointer<PERIPHERAL_RRI_CONFIG> pRriconfig)> ("cwsUpdateRRIConfig");
  clingNative.cwsSendRRIConfig = nativeLib.lookupFunction<Void Function(), void Function()>("cwsSendRRIConfig");
  clingNative.cwsUpdateStreamRRIConfig = nativeLib.lookupFunction<Void Function(Pointer<PERIPHERAL_STREAMRRI_CONFIG> pStreamrriconfig), void Function(Pointer<PERIPHERAL_STREAMRRI_CONFIG> pStreamrriconfig)> ("cwsUpdateStreamRRIConfig");
  clingNative.cwsUpdateStreamRRIParam = nativeLib.lookupFunction<Void Function(Pointer<PERIPHERAL_STREAMRRI_REQPARAM> pStreamrriparam), void Function(Pointer<PERIPHERAL_STREAMRRI_REQPARAM> pStreamrriparam)> ("cwsUpdateStreamRRIParam");
  clingNative.cwsSendStreamRRIConfig = nativeLib.lookupFunction<Void Function(), void Function()>("cwsSendStreamRRIConfig");
  clingNative.cwsReqStreamRRIParam = nativeLib.lookupFunction<Void Function(), void Function()>("cwsReqStreamRRIParam");
  clingNative.cwsUpdateAirData = nativeLib.lookupFunction<Void Function(Pointer<PERIPHERAL_AIR_DATA> pAirdata), void Function(Pointer<PERIPHERAL_AIR_DATA> pAirdata)> ("cwsUpdateAirData");
  clingNative.cwsSendAirData = nativeLib.lookupFunction<Void Function(), void Function()>("cwsSendAirData");
  clingNative.cwsUpdateLocationData = nativeLib.lookupFunction<Void Function(Pointer<PERIPHERAL_LOC_DATA> pLocdata), void Function(Pointer<PERIPHERAL_LOC_DATA> pLocdata)> ("cwsUpdateLocationData");
  clingNative.cwsSendLocationData = nativeLib.lookupFunction<Void Function(), void Function()>("cwsSendLocationData");
  clingNative.cwsUpdateVibraData = nativeLib.lookupFunction<Void Function(Pointer<PERIPHERAL_VIBRA_DATA> pVibra), void Function(Pointer<PERIPHERAL_VIBRA_DATA> pVibra)> ("cwsUpdateVibraData");
  clingNative.cwsSendVibraData = nativeLib.lookupFunction<Void Function(), void Function()>("cwsSendVibraData");
  clingNative.cwsUpdateAccDataConfig = nativeLib.lookupFunction<Void Function(Pointer<PERIPHERAL_ACC_DATA_CONFIG> pAccdataconfig), void Function(Pointer<PERIPHERAL_ACC_DATA_CONFIG> pAccdataconfig)> ("cwsUpdateAccDataConfig");
  clingNative.cwsSendAccDataConfig = nativeLib.lookupFunction<Void Function(), void Function()>("cwsSendAccDataConfig");
  clingNative.cwsEnableStreamingMode = nativeLib.lookupFunction<Void Function(Int bEnable), void Function(int bEnable)> ("cwsEnableStreamingMode");
  clingNative.cwsSetANCSCapability = nativeLib.lookupFunction<Void Function(Int bEnable, Short value), void Function(int bEnable, int value)> ("cwsSetANCSCapability");
  clingNative.cwsTrySmartNotification = nativeLib.lookupFunction<Void Function(Int bEnable, Int mode, Int id, Int count), void Function(int bEnable, int mode, int id, int count)> ("cwsTrySmartNotification");
  clingNative.cwsTrySmartNotificationWithContent = nativeLib.lookupFunction<Void Function(Int bEnable, Int mode, Int id, Int count, Pointer<Utf8> strphone, Pointer<Utf8> strcontent), void Function(int bEnable, int mode, int id, int count, Pointer<Utf8> strphone, Pointer<Utf8> strcontent)> ("cwsTrySmartNotificationWithContent");
  clingNative.cwsConfigureDevice = nativeLib.lookupFunction<Void Function(Pointer<PERIPHERAL_DEVICE_CONFIG_CONTEXT> pDevcfg), void Function(Pointer<PERIPHERAL_DEVICE_CONFIG_CONTEXT> pDevcfg)> ("cwsConfigureDevice");
  clingNative.cwsRebootPeripheral = nativeLib.lookupFunction<Void Function(), void Function()>("cwsRebootPeripheral");
  clingNative.cwsEmer_1update_1sleep_1state = nativeLib.lookupFunction<Void Function(), void Function()>("cwsEmer_1update_1sleep_1state");
  clingNative.cwsSetDeviceState = nativeLib.lookupFunction<Void Function(Int state), void Function(int state)> ("cwsSetDeviceState");
  clingNative.cwsSetDstOffset = nativeLib.lookupFunction<Void Function(Int state), void Function(int state)> ("cwsSetDstOffset");
  clingNative.cwsSetGmtOffset = nativeLib.lookupFunction<Void Function(Int state), void Function(int state)> ("cwsSetGmtOffset");
  clingNative.cwsSetLanguageType = nativeLib.lookupFunction<Void Function(Int language), void Function(int language)> ("cwsSetLanguageType");
  clingNative.cwsSetLanguageTypeDirectly = nativeLib.lookupFunction<Void Function(), void Function()>("cwsSetLanguageTypeDirectly");
  clingNative.cwsUpdateUserProfile = nativeLib.lookupFunction<Void Function(Int heightCM, Int weightKG, Int strideCM), void Function(int heightCM, int weightKG, int strideCM)> ("cwsUpdateUserProfile");
  clingNative.cwsUpdateUserProfileCfg = nativeLib.lookupFunction<Void Function(Pointer<PERIPHERAL_USER_PROFILE_DATA> pPeriUser), void Function(Pointer<PERIPHERAL_USER_PROFILE_DATA> pPeriUser)> ("cwsUpdateUserProfileCfg");
  clingNative.cwsSetUserProfileDirectly = nativeLib.lookupFunction<Void Function(), void Function()>("cwsSetUserProfileDirectly");
  clingNative.cwsUpdatePhoneCallerInfo = nativeLib.lookupFunction<Void Function(Pointer<Utf8> phoneNo, Pointer<Utf8> caller), void Function(Pointer<Utf8> phoneNo, Pointer<Utf8> caller)> ("cwsUpdatePhoneCallerInfo");
  clingNative.cwsUpdateSmsInfo = nativeLib.lookupFunction<Void Function(Pointer<Utf8> caller, Pointer<Utf8> msg), void Function(Pointer<Utf8> caller, Pointer<Utf8> msg)> ("cwsUpdateSmsInfo");
  clingNative.cwsReloadData = nativeLib.lookupFunction<Void Function(), void Function()>("cwsReloadData");
  clingNative.cwsSetupDevice = nativeLib.lookupFunction<Void Function(), void Function()>( "cwsSetupDevice");
  clingNative.cwsFormatDisk = nativeLib.lookupFunction<Void Function(), void Function()>("cwsFormatDisk");
  clingNative.cwsIsDiskFormatEnd = nativeLib.lookupFunction<Int Function(UnsignedInt), int Function(int)>("cwsIsDiskFormatEnd");
  clingNative.cwsRequestForceAuth = nativeLib.lookupFunction<Void Function(), void Function()>("cwsRequestForceAuth");
  clingNative.cwsCheckAuthorizationState = nativeLib.lookupFunction<Int Function(), int Function()>("cwsCheckAuthorizationState");
  clingNative.cwsLoadFileList = nativeLib.lookupFunction<Void Function(), void Function()>("cwsLoadFileList");
  clingNative.cwsCheckFileWrite = nativeLib.lookupFunction<Int Function(), int Function()>("cwsCheckFileWrite");
  clingNative.cwsLoadDailyActivityTotal = nativeLib.lookupFunction<Void Function(), void Function()>("cwsLoadDailyActivityTotal");
  clingNative.cwsSendSimulation = nativeLib.lookupFunction<Void Function(Int byteData), void Function(int byteData)> ("cwsSendSimulation");
  clingNative.cwsLoadDeviceInfo = nativeLib.lookupFunction<Void Function(), void Function()>("cwsLoadDeviceInfo");
  clingNative.cwsTimeSync = nativeLib.lookupFunction<Void Function(), void Function()>("cwsTimeSync");
  clingNative.cwsSleepAlg = nativeLib.lookupFunction<Void Function(Pointer<Int> pActivityData, Pointer<Int> pWalk_buf, Pointer<Int> pWorkoutData, Pointer<Int> pHr_buf, Int bHr_Avail, Pointer<Int> pSleep_buf, Int length), void Function(Pointer<Int> pActivityData, Pointer<Int> pWalk_buf, Pointer<Int> pWorkoutData, Pointer<Int> pHr_buf, int bHr_Avail, Pointer<Int> pSleep_buf, int length)> ("cwsSleepAlg");
  clingNative.cwsSendCommand = nativeLib.lookupFunction<Void Function(Int cmd, Pointer<Char> pData, Int length), void Function(int cmd, Pointer<Char> pData, int length)> ("cwsSendCommand");
  clingNative.cwsSendFinanceCommand = nativeLib.lookupFunction<Void Function(Pointer<Char> pData, Int length), void Function(Pointer<Char> pData, int length)> ("cwsSendFinanceCommand");
  clingNative.cwsSendWorkoutMsg = nativeLib.lookupFunction<Void Function(Int distance, Int speed), void Function(int distance, int speed)> ("cwsSendWorkoutMsg");
  clingNative.cwsSendWorkoutGpsStatus = nativeLib.lookupFunction<Void Function(Int gps_status), void Function(int gps_status)> ("cwsSendWorkoutGpsStatus");
  clingNative.cwsGetFileDownloadState = nativeLib.lookupFunction<Int Function(), int Function()>("cwsGetFileDownloadState");
  clingNative.cwsStartFileDownload = nativeLib.lookupFunction<Void Function(Int index), void Function(int index)> ("cwsStartFileDownload");
  clingNative.cwsDownloadFileStateMachine = nativeLib.lookupFunction<Int Function(), int Function()> ("cwsDownloadFileStateMachine");
  clingNative.cwsSetFileDownloadState = nativeLib.lookupFunction<Void Function(Int state), void Function(int state)> ("cwsSetFileDownloadState");
  clingNative.cwsSetFileDownloadParams = nativeLib.lookupFunction<Int Function(Pointer<Utf8> strFileName, Pointer<Utf8> strExeFileName, Pointer<Void> arrayBody, Int length, Int index), int Function(Pointer<Utf8> strFileName, Pointer<Utf8> strExeFileName, Pointer<Void> arrayBody, int length, int index)> ("cwsSetFileDownloadParams");
  clingNative.cwsUpdateFileDownloadParams = nativeLib.lookupFunction<Int Function(Pointer<Utf8> strFileName, Pointer<Utf8> strExeFileName, Pointer<Void> arrayBody, Int length, Int index), int Function(Pointer<Utf8> strFileName, Pointer<Utf8> strExeFileName, Pointer<Void> arrayBody, int length, int index)> ("cwsUpdateFileDownloadParams");
  clingNative.cwsSendGpsDataInfo = nativeLib.lookupFunction<Void Function(Long timestamp, Double dLon, Double dLat, Double dSpeed), void Function(int timestamp, double dLon, double dLat, double dSpeed)> ("cwsSendGpsDataInfo");
  clingNative.cwsSetPillReminder = nativeLib.lookupFunction<Void Function(Pointer<PERIPHERAL_PILL_REMINDER_CONTEXT> pReminder, Int index, Int bUpdate), void Function(Pointer<PERIPHERAL_PILL_REMINDER_CONTEXT> pReminder, int index, int bUpdate)> ("cwsSetPillReminder");
  clingNative.cwsSendPillReminder = nativeLib.lookupFunction<Void Function(), void Function()>("cwsSendPillReminder");
  clingNative.cwsClearPillReminders = nativeLib.lookupFunction<Void Function(), void Function()>("cwsClearPillReminders");
  clingNative.cwsFormatMinuteData = nativeLib.lookupFunction<Void Function(Pointer<UnsignedChar> arrayBody), void Function(Pointer<UnsignedChar> arrayBody)> ("cwsFormatMinuteData");
  clingNative.cwsGetProtocolName = nativeLib.lookupFunction<Pointer<Utf8> Function(Int pid), Pointer<Utf8> Function(int pid)> ("cwsGetProtocolName");
  clingNative.cwsGetAuthTokenCodeKey = nativeLib.lookupFunction<Pointer<Utf8> Function(), Pointer<Utf8> Function()> ("cwsGetAuthTokenCodeKey");
  clingNative.cwsGetSystemCmdName = nativeLib.lookupFunction<Pointer<Utf8> Function(Int sid), Pointer<Utf8> Function(int sid)> ("cwsGetSystemCmdName");
  clingNative.cwsSetMtuSize = nativeLib.lookupFunction<Void Function(Int nMtuSize), void Function(int nMtuSize)> ("cwsSetMtuSize");
  clingNative.cwsPeripheralProcess = nativeLib.lookupFunction<Void Function(), void Function()> ("cwsPeripheralProcess");

  // helloWorld();
}