summaryrefslogtreecommitdiff
path: root/libs/ihealth-sdk/android/src/main/java/com/ihealth/ihealthlibrary/PT3SBTProfileModule.java
blob: 7ef128288bacdbdb1807297511b6f6ad04dc387c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package com.ihealth.ihealthlibrary;

import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.module.annotations.ReactModule;
import com.ihealth.communication.control.Pt3sbtProfile;
import com.ihealth.communication.control.TS28BProfile;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Nullable;

@ReactModule(name = "PT3SBTProfileModule")
public class PT3SBTProfileModule extends ReactContextBaseJavaModule {

    private static final String modelName = PT3SBTProfileModule.class.getSimpleName();
    private static final String TAG = PT3SBTProfileModule.class.getSimpleName();

    private static final String ACTION_SET_TIME = "ACTION_SET_TIME";
    private static final String ACTION_GET_BATTERY = "ACTION_GET_BATTERY";
    private static final String ACTION_SET_UNIT = "ACTION_SET_UNIT";
    private static final String ACTION_GET_UNIT = "ACTION_GET_UNIT";
    private static final String ACTION_GET_HISTORY_COUNT = "ACTION_GET_HISTORY_COUNT";
    private static final String ACTION_GET_HISTORY_DATA = "ACTION_GET_HISTORY_DATA";
    private static final String ACTION_DELETE_HISTORY_DATA = "ACTION_DELETE_HISTORY_DATA";
    private static final String ACTION_TEMPERATURE_MEASUREMENT = "ACTION_TEMPERATURE_MEASUREMENT";
    private static final String ACTION_PUB_UNIT = "ACTION_PUB_UNIT";
    private static final String ACTION_GET_ALL_CONNECTED_DEVICES = "ACTION_GET_ALL_CONNECTED_DEVICES";

    private static final String STATUS = "STATUS";
    private static final String BATTERY = "BATTERY";
    private static final String UNIT = "UNIT";
    private static final String COUNT = "COUNT";
    private static final String TEMPERATURE = "TEMPERATURE";
    private static final String TS = "TS";
    private static final String HISTORY = "HISTORY";

    public PT3SBTProfileModule(ReactApplicationContext reactContext) {
        super(reactContext);
    }

    @Override
    public String getName() {
        return modelName;
    }

    @Nullable
    @Override
    public Map<String, Object> getConstants() {
        Map<String, Object> constants = new HashMap<>();
        constants.put(ACTION_SET_TIME, Pt3sbtProfile.ACTION_SET_TIME);
        constants.put(ACTION_GET_BATTERY, Pt3sbtProfile.ACTION_GET_BATTERY);
        constants.put(ACTION_SET_UNIT, Pt3sbtProfile.ACTION_SET_UNIT);
        constants.put(ACTION_GET_UNIT, Pt3sbtProfile.ACTION_GET_UNIT);
        constants.put(ACTION_GET_HISTORY_COUNT, Pt3sbtProfile.ACTION_GET_HISTORY_COUNT);
        constants.put(ACTION_GET_HISTORY_DATA, Pt3sbtProfile.ACTION_GET_HISTORY_DATA);
        constants.put(ACTION_DELETE_HISTORY_DATA, Pt3sbtProfile.ACTION_DELETE_HISTORY_DATA);
        constants.put(ACTION_TEMPERATURE_MEASUREMENT, Pt3sbtProfile.ACTION_TEMPERATURE_MEASUREMENT);
        constants.put(ACTION_PUB_UNIT, Pt3sbtProfile.ACTION_PUB_UNIT);
        constants.put(ACTION_GET_ALL_CONNECTED_DEVICES, iHealthBaseModule.ACTION_GET_ALL_CONNECTED_DEVICES);

        constants.put(STATUS, Pt3sbtProfile.STATUS);
        constants.put(BATTERY, Pt3sbtProfile.BATTERY);
        constants.put(UNIT, Pt3sbtProfile.UNIT);
        constants.put(TS, Pt3sbtProfile.TS);
        constants.put(COUNT, Pt3sbtProfile.COUNT);
        constants.put(TEMPERATURE, Pt3sbtProfile.TEMPERATURE);
        constants.put(HISTORY, Pt3sbtProfile.HISTORY);

        return constants;
    }
}