package com.silencefun.comtest.been;

import android.util.Log;

import com.google.gson.Gson;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by silencefun on 2018/1/20.
 */

public class ComBean {

    public byte[] bRec=null;
    public String sRecTime="";
    public String sComPort="";
    public ComBean(String sPort,byte[] buffer,int size){
        sComPort=sPort;
        List<Byte> list=new ArrayList<>();
        for (int i = 0; i < buffer.length; i++) {
            if (buffer[i]!=10 && buffer[i]!= 13 && buffer[i]!=0){
                list.add(buffer[i]);
            }
        }
        bRec = new byte[list.size()];
        for (int i = 0; i < list.size(); i++) {
            bRec[i]=list.get(i);
        }
        Log.e("-----------数据 bRec  ",new Gson().toJson(bRec));
        SimpleDateFormat sDateFormat = new SimpleDateFormat("hh:mm:ss");
        sRecTime = sDateFormat.format(new java.util.Date());
    }
}
