Code not available

Hi, I am trying build a automated pet door wherein the pet is wearing a BLE Ibeaon Tile. If the RSSI is less than 1 feet, the project starts working. Flow Chart attached

Can you please help me with full code as it is my college project.
The Schematic

Here is code for BLE but I need to identify specific device in this
#include <BLEAdvertisedDevice.h>
#include <BLEDevice.h>
#include <BLEScan.h>

const int PIN = 2;
const int CUTOFF = -60;

void setup() {
pinMode(PIN, OUTPUT);

void loop() {
BLEScan *scan = BLEDevice::getScan();
BLEScanResults results = scan->start(1);
int best = CUTOFF;
for (int i = 0; i < results.getCount(); i++) {
BLEAdvertisedDevice device = results.getDevice(i);
int rssi = device.getRSSI();
if (rssi > best) {
best = rssi;
digitalWrite(PIN, best > CUTOFF ? HIGH : LOW);