nRF Connect with Zephyr Testing Framework: Mocking central role connection to test BLE peripheral UART

Hello!

I am trying to develop tests with Zephyr Ztest framework to determine proper code coverage. Part of my functions invoke BLE NUS send and receive. For this to work properly and verify BLE portion is correct, I'm trying to find ways to mock the central connection that the device would connect to.

Are there any example codes or methods that I could mock the central connection that the testing code would connect to? This is so that the mocked central role can do things like enable TX notifications so the nus_send would go through.

Thanks!

Parents
  • Hello,

    Sorry for the long response time. I was out of the office for the last few days.
    What you mentioned about the BLE is true i.e notifications on BLE needs to be enabled. Peripheral can only access if the central enables the notification. But I think the issue here is because of the platforms( Ztest and Babblesim simulator) . I am completely unaware of this platform. So I have asked this internally if anyone has tried this under BLE. I will get back to you if I get a proper response.

    Kind Regards,

    Abhijith

Reply
  • Hello,

    Sorry for the long response time. I was out of the office for the last few days.
    What you mentioned about the BLE is true i.e notifications on BLE needs to be enabled. Peripheral can only access if the central enables the notification. But I think the issue here is because of the platforms( Ztest and Babblesim simulator) . I am completely unaware of this platform. So I have asked this internally if anyone has tried this under BLE. I will get back to you if I get a proper response.

    Kind Regards,

    Abhijith

Children
No Data
Related