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

Get peer address in SDK for IoT

I'd like to get peer address after the connection between nRF52 and other 6lowpan device is established. This address will be then used to create a TCP connection with some server running there. After reviewing SDK for IoT source code, I found that this address will be kept in m_blenetif_table array located in file nrf_platform_port.c. I should be able to access the blenetif structure by state member in netif structure in lwIP. The problem is that blenetif structure is defined in source file and therefore not publicly accessible for SDK for IoT users. Are there any plans for SDK for IoT to make this address publicly available? Are there other ways to access this address?

Parents
  • Hi Piotr,

    The m_blenetif_table maintains the mapping between the BLE network interfaces and the lwIP IP stack. Therefore, this consists of:

    1. p_ble_interface of type iot_interface_t and
    2. netif of type netif.

    The netif structure does not contain any peer address or BLE specific information. Hence its unlikely that this data structure will ever be exposed publicly.

    On the otherhand, iot_interface_t is seen as the handle reference across layers that contain information or pointer to information relevant to an application delevoper.

    In future, the nrf_driver_interface_up and nrf_driver_interface_down funtions will include the pointer iot_interface_t as an input parameter.

    Hope this helps!

Reply
  • Hi Piotr,

    The m_blenetif_table maintains the mapping between the BLE network interfaces and the lwIP IP stack. Therefore, this consists of:

    1. p_ble_interface of type iot_interface_t and
    2. netif of type netif.

    The netif structure does not contain any peer address or BLE specific information. Hence its unlikely that this data structure will ever be exposed publicly.

    On the otherhand, iot_interface_t is seen as the handle reference across layers that contain information or pointer to information relevant to an application delevoper.

    In future, the nrf_driver_interface_up and nrf_driver_interface_down funtions will include the pointer iot_interface_t as an input parameter.

    Hope this helps!

Children
Related