package com.example.jinyu_rfid.broadcast;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.example.jinyu_rfid.callback.DataReturnCall;

public class ScanERCodeReceiver extends BroadcastReceiver {
    private DataReturnCall call;

    public ScanERCodeReceiver() {
    }

    public ScanERCodeReceiver(DataReturnCall call) {
        this.call = call;
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        byte[] data = intent.getByteArrayExtra("data");
        if (data != null) {
            String barcode = new String(data);
            Log.e("", "onReceive, data:" + barcode);
            call.readerCodeInfo(barcode);
        }
    }
}