detect other BlueNRG

benstada

  • Newbie
  • *
    • Posts: 3
    • View Profile
Have to program two wedding rings with a tiny screen and BLE to detect the other ring is in the  neighbourhood and the generate hearts.
The screens are running with the UARTPassThrough.ino example merged with my code and i see them in my phone as two BlueNRGs.
How do i detect the other one is near by?
What do i use?
aci_gap_start_general_discovery_proc(0x4000, 0x4000, 0x00, 0x01); returns 12 which is BLE_STATUS_INVALID_PARAMETER
Can someone point me in the right direction?

Thank You.



benstada

  • Newbie
  • *
    • Posts: 3
    • View Profile
Now I am so far that both BlueNRGs are visible on my phone with the nrf connect app.
They both send data to my phone and my phone can send RX data as Command to the BlueNrgs
However the data send by one BlueNrg is not recievied by the other.
I am using lib_aci_send_data(PIPE_UART_OVER_BTLE_UART_TX_TX, (uint8_t*)sendBuffer, sendLength))  the buffer contains hello which I receive on my phone.
Maybe it is necessary to connect to the other BlueNRG and enable notifications, I do connect ion my phone  and enable notifications.
Maybe I can Set the Pipe of my other  BLueNrg but I don't know what the ID is.

If the one BlueNRG receives data from the other it knows it's in the neighbourhood.
« Last Edit: August 01, 2023, 06:30:25 AM by benstada »


benstada

  • Newbie
  • *
    • Posts: 3
    • View Profile
void loop() {
  uint8_t sendBuffer[21]="hello\0";
  uint8_t sendLength = 6;
  aci_loop(); //Process any ACI commands or events from the NRF8001- main BLE handler, must run often. Keep main loop short.
  if (ble_rx_buffer_len) {//Check if data is available
    if (SerialMonitorInterface.available()) {
      SerialMonitorInterface.print(ble_rx_buffer_len);
      SerialMonitorInterface.print(" : ");
      SerialMonitorInterface.println((char*)ble_rx_buffer);
    }
    contact();
    ble_rx_buffer_len = 0;//clear afer reading
  }
  else {
    lib_aci_send_data(PIPE_UART_OVER_BTLE_UART_TX_TX, (uint8_t*)sendBuffer, sendLength);
  }
}


 

SMF spam blocked by CleanTalk