@youssefhenna/expo-enode-link-sdk
Version:
An Expo Module integration for Enode's Link SDK
22 lines (21 loc) • 7.44 kB
JavaScript
/*jslint
browser
*/
/*global
atob, Event, nslog, window
*/
// Copyright 2016-2017 Paul Theriault and David Park. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// adapted from chrome app polyfill https://github.com/WebBluetoothCG/chrome-app-polyfill
!function(){"use strict";function _(e){let t="0000000"+(e>>>=0).toString(16);return(t=t.substr(-8))+"-0000-1000-8000-00805f9b34fb"}nslog("Create BluetoothUUID");const a=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,i=/^[0-9a-f]{4}([0-9a-f]{4})?$/i;let e={};function t(t){let r=e[t];return function(e){if("number"==typeof e)return _(e);if(a.test(e))return e.toLowerCase();if(r.hasOwnProperty(e))return r[e];if(i.test(e))return _(parseInt(e,16));throw new TypeError(e+` is not a known ${t} name.`)}}e.canonicalUUID=_,e.service={alert_notification:_(6161),automation_io:_(6165),battery_service:_(6159),blood_pressure:_(6160),body_composition:_(6171),bond_management:_(6174),continuous_glucose_monitoring:_(6175),current_time:_(6149),cycling_power:_(6168),cycling_speed_and_cadence:_(6166),device_information:_(6154),environmental_sensing:_(6170),generic_access:_(6144),generic_attribute:_(6145),glucose:_(6152),health_thermometer:_(6153),heart_rate:_(6157),human_interface_device:_(6162),immediate_alert:_(6146),indoor_positioning:_(6177),internet_protocol_support:_(6176),link_loss:_(6147),location_and_navigation:_(6169),next_dst_change:_(6151),phone_alert_status:_(6158),pulse_oximeter:_(6178),reference_time_update:_(6150),running_speed_and_cadence:_(6164),scan_parameters:_(6163),tx_power:_(6148),user_data:_(6172),weight_scale:_(6173)},e.characteristic={aerobic_heart_rate_lower_limit:_(10878),aerobic_heart_rate_upper_limit:_(10884),aerobic_threshold:_(10879),age:_(10880),aggregate:_(10842),alert_category_id:_(10819),alert_category_id_bit_mask:_(10818),alert_level:_(10758),alert_notification_control_point:_(10820),alert_status:_(10815),altitude:_(10931),anaerobic_heart_rate_lower_limit:_(10881),anaerobic_heart_rate_upper_limit:_(10882),anaerobic_threshold:_(10883),analog:_(10840),apparent_wind_direction:_(10867),apparent_wind_speed:_(10866),"gap.appearance":_(10753),barometric_pressure_trend:_(10915),battery_level:_(10777),blood_pressure_feature:_(10825),blood_pressure_measurement:_(10805),body_composition_feature:_(10907),body_composition_measurement:_(10908),body_sensor_location:_(10808),bond_management_control_point:_(10916),bond_management_feature:_(10917),boot_keyboard_input_report:_(10786),boot_keyboard_output_report:_(10802),boot_mouse_input_report:_(10803),"gap.central_address_resolution_support":_(10918),cgm_feature:_(10920),cgm_measurement:_(10919),cgm_session_run_time:_(10923),cgm_session_start_time:_(10922),cgm_specific_ops_control_point:_(10924),cgm_status:_(10921),csc_feature:_(10844),csc_measurement:_(10843),current_time:_(10795),cycling_power_control_point:_(10854),cycling_power_feature:_(10853),cycling_power_measurement:_(10851),cycling_power_vector:_(10852),database_change_increment:_(10905),date_of_birth:_(10885),date_of_threshold_assessment:_(10886),date_time:_(10760),day_date_time:_(10762),day_of_week:_(10761),descriptor_value_changed:_(10877),"gap.device_name":_(10752),dew_point:_(10875),digital:_(10838),dst_offset:_(10765),elevation:_(10860),email_address:_(10887),exact_time_256:_(10764),fat_burn_heart_rate_lower_limit:_(10888),fat_burn_heart_rate_upper_limit:_(10889),firmware_revision_string:_(10790),first_name:_(10890),five_zone_heart_rate_limits:_(10891),floor_number:_(10930),gender:_(10892),glucose_feature:_(10833),glucose_measurement:_(10776),glucose_measurement_context:_(10804),gust_factor:_(10868),hardware_revision_string:_(10791),heart_rate_control_point:_(10809),heart_rate_max:_(10893),heart_rate_measurement:_(10807),heat_index:_(10874),height:_(10894),hid_control_point:_(10828),hid_information:_(10826),hip_circumference:_(10895),humidity:_(10863),"ieee_11073-20601_regulatory_certification_data_list":_(10794),indoor_positioning_configuration:_(10925),intermediate_blood_pressure:_(10806),intermediate_temperature:_(10782),irradiance:_(10871),language:_(10914),last_name:_(10896),latitude:_(10926),ln_control_point:_(10859),ln_feature:_(10858),"local_east_coordinate.xml":_(10929),local_north_coordinate:_(10928),local_time_information:_(10767),location_and_speed:_(10855),location_name:_(10933),longitude:_(10927),magnetic_declination:_(10796),magnetic_flux_density_2D:_(10912),magnetic_flux_density_3D:_(10913),manufacturer_name_string:_(10793),maximum_recommended_heart_rate:_(10897),measurement_interval:_(10785),model_number_string:_(10788),navigation:_(10856),new_alert:_(10822),"gap.peripheral_preferred_connection_parameters":_(10756),"gap.peripheral_privacy_flag":_(10754),plx_continuous_measurement:_(10847),plx_features:_(10848),plx_spot_check_measurement:_(10846),pnp_id:_(10832),pollen_concentration:_(10869),position_quality:_(10857),pressure:_(10861),protocol_mode:_(10830),rainfall:_(10872),"gap.reconnection_address":_(10755),record_access_control_point:_(10834),reference_time_information:_(10772),report:_(10829),report_map:_(10827),resting_heart_rate:_(10898),ringer_control_point:_(10816),ringer_setting:_(10817),rsc_feature:_(10836),rsc_measurement:_(10835),sc_control_point:_(10837),scan_interval_window:_(10831),scan_refresh:_(10801),sensor_location:_(10845),serial_number_string:_(10789),"gatt.service_changed":_(10757),software_revision_string:_(10792),sport_type_for_aerobic_and_anaerobic_thresholds:_(10899),supported_new_alert_category:_(10823),supported_unread_alert_category:_(10824),system_id:_(10787),temperature:_(10862),temperature_measurement:_(10780),temperature_type:_(10781),three_zone_heart_rate_limits:_(10900),time_accuracy:_(10770),time_source:_(10771),time_update_control_point:_(10774),time_update_state:_(10775),time_with_dst:_(10769),time_zone:_(10766),true_wind_direction:_(10865),true_wind_speed:_(10864),two_zone_heart_rate_limit:_(10901),tx_power_level:_(10759),uncertainty:_(10932),unread_alert_status:_(10821),user_control_point:_(10911),user_index:_(10906),uv_index:_(10870),vo2_max:_(10902),waist_circumference:_(10903),weight:_(10904),weight_measurement:_(10909),weight_scale_feature:_(10910),wind_chill:_(10873)},e.descriptor={"gatt.characteristic_extended_properties":_(10496),"gatt.characteristic_user_description":_(10497),"gatt.client_characteristic_configuration":_(10498),"gatt.server_characteristic_configuration":_(10499),"gatt.characteristic_presentation_format":_(10500),"gatt.characteristic_aggregate_format":_(10501),valid_range:_(10502),external_report_reference:_(10503),report_reference:_(10504),value_trigger_setting:_(10506),es_configuration:_(10507),es_measurement:_(10508),es_trigger_setting:_(10509)},e.getService=t("service"),e.getCharacteristic=t("characteristic"),e.getDescriptor=t("descriptor"),window.BluetoothUUID=e,nslog("BluetoothUUID imported")}();