         return false;
     }
 
-    _adv_config.p_manufacturer_data = custom_data.raw;
-    _adv_config.manufacturer_len = sizeof(custom_data_t);
-    if(esp_ble_gap_config_adv_data(&_adv_config)){
+    if(esp_ble_gap_config_adv_data(&advertisement_config)){
         log_e("gap_config_adv_data failed");
         return false;
     }

        uint8_t       sideExclusionZoneDistance;    // W, scale 1m
        uint8_t       packetVersion;                // This is siteBKNS Packet Format Version 2
    } fields;
}custom_data_t;

// BEACON DUMMY DATA TO OBSERVE WIRE PROTOCOL DATA PACKING
// with five character local name, there remain two spare bytes (according to "nRF Connect" android app)
char * localName = "C9999";
int LOCALNAMESIZE = sizeof(localName);          
custom_data_t custom_data = 
{ .fields = 
  {   .companyID = 0xFFFF,                      // Reserved by Bluetooth Specification for internal testing
      .gpsForwardBearing=0x1111,                // Azimuth, scale 1 degree
      .gpsLatitute= 0x22222222,                 // X, scale 100000/0.00001m
      .gpsLongitude=0x33333333,                 // Y, scale 100000/0.00001m
      .gpsForwardSpeed=0x44,
      .forwardExclusionZoneDistance = 0xAA,     // F, scale 1m, max 256
      .rearExclusionZoneDistance = 0xBB,        // L, scale 1m, max 256
      .sideExclusionZoneDistance = 0xCC,        // W, scale 1m, max 256 
      .packetVersion = 0x02                     // This is siteBKNS packet format VERSION 2
  }
};

// BLE GAP ADVERTISING CONFIGURATION

static esp_ble_adv_data_t _adv_config = {
        .set_scan_rsp        = false,
        .include_name        = true,
        .include_txpower     = true,      // !!!! TX-power can help with backup distance calculation in GPS blackspots
        .min_interval        = 512,
        .max_interval        = 1024,
        .appearance          = 0,
        .manufacturer_len    = 0,
        .p_manufacturer_data = NULL,
        .service_data_len    = 0,
        .p_service_data      = NULL,
        .service_uuid_len    = 0,

    return true;
}

///////////////////////////
// GPS INPUT PARSING

void 
gps_read_into( beacon_data_t * beaconData)
{   
    static long counter = 0;  //example only
    counter = counter + 1;    //example only
    Serial.println(counter);
    //@Nancy, can you fill out the following with real GPS info?
    beaconData->fields.gpsForwardBearing            = counter;
    beaconData->fields.gpsLatitute                  = beaconData->fields.gpsLatitute;  // times by GPS_SCALE;
    beaconData->fields.gpsLongitude                 = beaconData->fields.gpsLongitude; // times by GPS_SCALE;
    beaconData->fields.gpsForwardSpeed              = beaconData->fields.gpsForwardSpeed;
    beaconData->fields.forwardExclusionZoneDistance = beaconData->fields.forwardExclusionZoneDistance;
    beaconData->fields.rearExclusionZoneDistance    = beaconData->fields.rearExclusionZoneDistance;
    beaconData->fields.sideExclusionZoneDistance    = beaconData->fields.sideExclusionZoneDistance;
}

 
//////////////////////////////
// ARDUINO SUPPORT FUNCTIONS

void 
setup() {
    Serial.begin(115200);
    Serial.setDebugOutput(true);
    pinMode(LED_BUILTIN, OUTPUT);
