本篇博客用于记录学习和使用github程序包Gen2-UHF-RFID-Reader的过程。出错的地方还望大家指正。
使用平台:ubuntu16.04 UHD3.14.0.HEAD-0-g6875d061 gnuradio3.7.10.1 USRP N210(SBX子板)
本篇详细分析global_vars.cc文件。
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gnuradio/io_signature.h>
#include "rfid/global_vars.h"
#include <iostream>
namespace gr {
namespace rfid {
READER_STATE * reader_state;
void initialize_reader_state()
{
reader_state = new READER_STATE;
reader_state-> reader_stats.n_queries_sent = 0;
reader_state-> reader_stats.n_epc_correct = 0;
std::vector<int> unique_tags_round;
std::map<std::string,int> tag_reads;
reader_state-> status = RUNNING;
reader_state-> gen2_logic_status= START;
reader_state-> gate_status = GATE_SEEK_RN16;
reader_state-> decoder_status = DECODER_DECODE_RN16;
reader_state-> reader_stats.max_slot_number = pow(2,FIXED_Q);
reader_state-> reader_stats.cur_inventory_round = 1;
reader_state-> reader_stats.cur_slot_number = 1;
gettimeofday (&reader_state-> reader_stats.start, NULL);
}
}
}
定义了reader的初始状态及数据统计初始值。值得注意的是,gate初始状态为seek_RN16,decoder模块初始状态为decode_RN16。