Reset the channel sounding parameters after a disconnection

Hi, I am trying to sound two reflectors from a single initiator, and since the CS works on a one-to-one ACL system, I wanted to know how I can reset the CS-related stuff in the code. I did try this without reboot, the data becomes stagnant after a reconnection or when I connect 2 reflectors (not sound, but just connect)  

The sample provided by Nordic does a soft reboot, so it works flawlessly. I am trying to take a different path of not connecting to both of my nodes at once and do a soft reboot every time I wanna switch the sounding, but I wanted to know if a manual reset was possible for the CS params and buffer, so that I can continue with sounding another device without doing a soft reboot.

Parents
  • Hello,

    This should be possible. You mention that you want one initiator and two reflectors. This will probably work, but if you are planning to have many reflectors, you may want to switch it around. You see, the main CPU usage is in the initiator, and the reflector is not doing any heavy lifting. This means that if you plan to have many stationary devices and one moving device, it may make sense to have the stationary devices being the initiators, all doing channel sounding towards the same reflector. This means that the moving device (reflector) can last longer on a smaller battery.

    without reboot, the data becomes stagnant after a reconnection

    What does it mean? do you get any channel sounding data from the second connection, or none at all?

    Best regards,

    Edvin

  • The data just come from the same step data which was saved into the buffer when it got disconnected or in another scenario when it gets connected with another reflector. I have a small log to show this, as soon as I connect the 2nd device it happens to stagnate the value.


    I: Scan started
    I: Filters matched. Address: F9:B1:53:59:F9:F5 (random) connectable: 1
    New Device F9:B1:53:59:F9:F5 (random) connected, total connected: 1
    I: Scan started
    I: Pairing completed: F9:B1:53:59:F9:F5 (random), bonded: 0
    I: Security changed: F9:B1:53:59:F9:F5 (random) level 2
    I: MTU exchange success (498)
    I: Service discovery completed for NUS
    I: Service discovery completed for RAS
    I: Read RAS feature bits: 0x1
    I: CS capability exchange completed.
    I: CS config creation complete. ID: 0
    I: CS security enabled.
    I: CS procedures enabled:
    - config ID: 0
    - antenna configuration index: 0
    - TX power: 0 dbm
    - subevent length: 28198 us
    - subevents per event: 1
    - subevent interval: 0
    - event interval: 2
    - procedure interval: 5
    - procedure count: 0
    - maximum procedure length: 1000

    I: 2.634895,4.304833,5.259593
    I: 2.634895,4.304833,5.259593
    I: 3.869948,4.385984,5.259593
    E: empty step data
    I: 3.869948,4.385984,5.259593
    I: 3.869948,4.385984,5.259593
    Data from Reflector 2
    I: 3.869948,4.385984,5.259593

    I: Filters matched. Address: F3:75:57:CA:A5:3A (random) connectable: 1
    I: 3.869948,4.385984,5.259593
    New Device F3:75:57:CA:A5:3A (random) connected, total connected: 2
    I: Scan started

    I: 4.008082,4.385984,5.201116
    E: empty step data
    I: 4.008082,4.385984,5.201116
    I: 4.008082,4.385984,5.201116
    I: 4.008082,4.385984,5.201116
    E: empty step data
    I: 4.008082,4.385984,5.201116
    I: 4.008082,4.385984,5.201116
    E: empty step data
    I: 4.008082,4.385984,5.201116
    I: 4.008082,4.385984,5.201116
    I: 4.008082,4.385984,5.201116
    E: empty step data
    I: 4.008082,4.385984,5.201116
    I: 4.008082,4.385984,5.201116
    E: empty step data

    I did try to do the bt_le_cs_procedure_enable(), with parameters as .enable to be set to 0. But it didn’t work. Is there a way to reset this? Like an API function call??

Reply
  • The data just come from the same step data which was saved into the buffer when it got disconnected or in another scenario when it gets connected with another reflector. I have a small log to show this, as soon as I connect the 2nd device it happens to stagnate the value.


    I: Scan started
    I: Filters matched. Address: F9:B1:53:59:F9:F5 (random) connectable: 1
    New Device F9:B1:53:59:F9:F5 (random) connected, total connected: 1
    I: Scan started
    I: Pairing completed: F9:B1:53:59:F9:F5 (random), bonded: 0
    I: Security changed: F9:B1:53:59:F9:F5 (random) level 2
    I: MTU exchange success (498)
    I: Service discovery completed for NUS
    I: Service discovery completed for RAS
    I: Read RAS feature bits: 0x1
    I: CS capability exchange completed.
    I: CS config creation complete. ID: 0
    I: CS security enabled.
    I: CS procedures enabled:
    - config ID: 0
    - antenna configuration index: 0
    - TX power: 0 dbm
    - subevent length: 28198 us
    - subevents per event: 1
    - subevent interval: 0
    - event interval: 2
    - procedure interval: 5
    - procedure count: 0
    - maximum procedure length: 1000

    I: 2.634895,4.304833,5.259593
    I: 2.634895,4.304833,5.259593
    I: 3.869948,4.385984,5.259593
    E: empty step data
    I: 3.869948,4.385984,5.259593
    I: 3.869948,4.385984,5.259593
    Data from Reflector 2
    I: 3.869948,4.385984,5.259593

    I: Filters matched. Address: F3:75:57:CA:A5:3A (random) connectable: 1
    I: 3.869948,4.385984,5.259593
    New Device F3:75:57:CA:A5:3A (random) connected, total connected: 2
    I: Scan started

    I: 4.008082,4.385984,5.201116
    E: empty step data
    I: 4.008082,4.385984,5.201116
    I: 4.008082,4.385984,5.201116
    I: 4.008082,4.385984,5.201116
    E: empty step data
    I: 4.008082,4.385984,5.201116
    I: 4.008082,4.385984,5.201116
    E: empty step data
    I: 4.008082,4.385984,5.201116
    I: 4.008082,4.385984,5.201116
    I: 4.008082,4.385984,5.201116
    E: empty step data
    I: 4.008082,4.385984,5.201116
    I: 4.008082,4.385984,5.201116
    E: empty step data

    I did try to do the bt_le_cs_procedure_enable(), with parameters as .enable to be set to 0. But it didn’t work. Is there a way to reset this? Like an API function call??

Children
  • // Disable CS procedures
    struct bt_le_cs_procedure_enable_param params = {
    .config_id = CS_CONFIG_ID,
    .enable = 0,
    };
    err = bt_le_cs_procedure_enable(conn, &params);
    if (err) {
    LOG_WRN("Failed to disable CS procedures (err %d)", err);
    }


    The above function yields me the following log with error as EIO 5 /* I/O error */


    Disconnected: F3:75:57:CA:A5:3A (random), reason 0x08
    W: opcode 0x2094 status 0x02
    W: Failed to disable CS procedures (err -5)

Related