This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Experimental Eddystone from SDK 11

nRF5_SDK_11.0.0_new\examples\ble_peripheral\experimental_ble_app_eddystone\pca10028\s130\arm5_no_packs

Using the above mentioned example on a custom board with nf51822. i want to transmit both eddystone uid and tlm frames at the same time is this possible?

Also is there any system call that can be used to load the instance id with the mac id in the main.c code itself. 

if yes, please guide me to do the above mentioned tasks.

  •  This is the schematic of the custom board for better understanding of the scenario.

  • Hi,

    The experimental Eddystone example in SDK 11 does not support multiple frames, but you can upgrade to SDK 12.3.0 which support up to 5 frames (Eddystone Beacon Application).  

    Also is there any system call that can be used to load the instance id with the mac id in the main.c code itself. 

     Yes, you can use sd_ble_gap_address_get() for this. 

  • Please help me out on where can i use this statement ?

    Can i use it along with the define statements in the main.c in the definition of instance id? If i am using this statement is there any other parameters i need to consider. I am new to the nordic development environment, thank you.

  • static void advertising_init(void)
    {
    uint32_t err_code;
    ble_advdata_t advdata;
    uint8_t flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
    ble_uuid_t adv_uuids[] = {{APP_EDDYSTONE_UUID, BLE_UUID_TYPE_BLE}};

    ble_gap_addr_t *p_mac1;
    sd_ble_gap_address_get(p_mac1);
    eddystone_uid_data[3] = (uint8_t) p_mac1;

    uint8_array_t eddystone_data_array; // Array for Service Data structure.
    /** @snippet [Eddystone data array] */
    eddystone_data_array.p_data = (uint8_t *) eddystone_uid_data; // Pointer to the data to advertise.
    eddystone_data_array.size = sizeof(eddystone_uid_data); // Size of the data to advertise.
    /** @snippet [Eddystone data array] */

    ble_advdata_service_data_t service_data; // Structure to hold Service Data.
    service_data.service_uuid = APP_EDDYSTONE_UUID; // Eddystone UUID to allow discoverability on iOS devices.
    service_data.data = eddystone_data_array; // Array for service advertisement data.

    // Build and set advertising data.
    memset(&advdata, 0, sizeof(advdata));

    advdata.name_type = BLE_ADVDATA_NO_NAME;
    advdata.flags = flags;
    advdata.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
    advdata.uuids_complete.p_uuids = adv_uuids;
    advdata.p_service_data_array = &service_data; // Pointer to Service Data structure.
    advdata.service_data_count = 1;

    err_code = ble_advdata_set(&advdata, NULL);
    APP_ERROR_CHECK(err_code);

    // Initialize advertising parameters (used when starting advertising).
    memset(&m_adv_params, 0, sizeof(m_adv_params));

    m_adv_params.type = BLE_GAP_ADV_TYPE_ADV_NONCONN_IND;
    m_adv_params.p_peer_addr = NULL; // Undirected advertisement.
    m_adv_params.fp = BLE_GAP_ADV_FP_ANY;
    m_adv_params.interval = NON_CONNECTABLE_ADV_INTERVAL;
    m_adv_params.timeout = APP_CFG_NON_CONN_ADV_TIMEOUT;
    }

    This is where i used the function call but there was no change in the advertising data.

    sd_ble_gap_address_get()
  • Hi,

    it looks like you are writing one byte of your pointer value to  APP_EDDYSTONE_UID_NAMESPACE. 

    Try to replace this code:

    ble_gap_addr_t *p_mac1;
    sd_ble_gap_address_get(p_mac1);
    eddystone_uid_data[3] = (uint8_t) p_mac1;

    With this:

    ble_gap_addr_t addr;

    err_code = sd_ble_gap_address_get(&addr);
    APP_ERROR_CHECK(err_code);

    /*Offset of APP_EDDYSTONE_UID_ID = APP_EDDYSTONE_UID_FRAME_TYPE+APP_EDDYSTONE_RSSI+APP_EDDYSTONE_UID_NAMESPACE*/
    memcpy(&eddystone_uid_data[12], addr.addr, sizeof(addr.addr));

    Edit: you should use SDK 12.3.0. The eddistone example was in an experimental state in SDK 11. 

Related