package com.handset.serialportsensor.constant;

import android.graphics.Color;

public class Constant {
    public final static String SENSOR_ID = "sensor_id";
    public final static String BAUD_RATE = "baud_rate";
    public static final String ROLE_KEY = "role_key";
    public static final int NOT_CONNECTED_ROLE = 0;
    public static final int PRIMARY_ROLE = 1;
    public static final int SENIOR_ROLE = 2;

    public static final int BAUD_9600 = 9600;
    public static final int BAUD_19200 = 19200;
    public static final int BAUD_38400 = 38400;

    public static final String DDDD = "DDDD";

    //ID高16位
    public static final String ID_HIGH_KEY = "id_high_key";
    //ID低16位
    public static final String ID_LOW_KEY = "id_low_key";
    public static final String THRESHOLD_KEY = "id_key";
    public static final String idHigh1 = "id1";
    public static final String idHigh2 = "id2";
    public static final String idHigh3 = "id3";
    public static final String idHigh4 = "id4";

    public static final int READ_TIME_OUT = 3000;
    public static final int READ_TIME_OUT_TIME = 1000;//延迟1秒

    public static final String FORMAT_FLOAT_PATTERN = "0.00";

    public final static int red = Color.rgb((255), (0), (0));
    public final static int green = Color.rgb((0), (255), (0));
    public final static int yellow = Color.rgb((255), (255), (0));
    public final static int grey = Color.rgb((0x9d), (0x9d), (0x9d));

    public static final class Command {
        public static final int COMMAND_25 = 0x25;//ID查询
        public static final int COMMAND_26 = 0x26;//ID上报
        public static final int COMMAND_27 = 0x27;//检测仪模式切换
        public static final int COMMAND_28 = 0x28;//模式切换结果指令上报
        public static final int COMMAND_29 = 0x29;//温度指令上报
        public static final int COMMAND_2A = 0x2A;//内压指令上报
        public static final int COMMAND_2B = 0x2B;//湿度指令上报
        public static final int COMMAND_2C = 0x2C;//外压指令上报
        public static final int COMMAND_2D = 0x2D;//差压指令上报
        public static final int COMMAND_2E = 0x2E;//20度湿度指令上报
        public static final int COMMAND_2F = 0x2F;//20度内压指令上报
        public static final int COMMAND_30 = 0x30;//弹号读取
        public static final int COMMAND_31 = 0x31;//弹号指令上报
        public static final int COMMAND_32 = 0x32;//弹号设置
        public static final int COMMAND_33 = 0x33;//弹号设置指令上报
        public static final int COMMAND_34 = 0x34;//筒号读取
        public static final int COMMAND_35 = 0x35;//筒号指令上报
        public static final int COMMAND_36 = 0x36;//筒号设置
        public static final int COMMAND_37 = 0x37;//筒号设置指令上报
        public static final int COMMAND_38 = 0x38;//弹筒使用次数读取
        public static final int COMMAND_39 = 0x39;//弹筒使用次数指令上报
        public static final int COMMAND_3A = 0x3A;//弹筒使用次数设置
        public static final int COMMAND_3B = 0x3B;//弹筒使用次数设置指令上报
        public static final int COMMAND_3C = 0x3C;//波特率设置
        public static final int COMMAND_3D = 0x3D;//波特率设置结果指令上报
        public static final int COMMAND_3E = 0x3E; //弹型读取
        public static final int COMMAND_3F = 0x3F; //弹型读取回复
        public static final int COMMAND_40 = 0x40;  //弹型设置
        public static final int COMMAND_41 = 0x41; //弹型设置回复
        public static final int COMMAND_49 = 0x49;//恢复出厂设置
        public static final int COMMAND_4A = 0x4A;//恢复出厂设置结果返回
        public static final int COMMAND_50 = 0x50;//传感器ID设置
        public static final int COMMAND_51 = 0x51;//传感器ID设置
    }
}
