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

Expand services, characteristics and descriptors from nRF Connect desktop

Hello Team,

I am trying to develop an app with BLE example as the base and modifying it.

Hardware setup:

PC - Windows 10, nRF Connect launcher v3.6.1, BLE example app,  nRF52840 Dongle connected to PC
Peripheral - A small device with a sensor and a nRF52840 SoC transmitting sensor data

After I connect my device as shown in the picture below. the services are discovered and shown automatically.


When I click on a service , it expands and shows the characteristics normally after being connected.
I tried to do this manually via the clicking on UI, as I wanted to discover the characteristics of a service to start using it.

I have tried writing functions to extract characteristics and descriptors in the modified BLE app.
Below is a function to extract Characteristics

        extractChar(service, uuid) {
            const { device, deviceDetails } = this.props;
            const { instanceId } = device;
            let retval;

            if (service) {
                const deviceDetail = deviceDetails.devices.get(instanceId);

                if (!deviceDetail.discoveringChildren) {
                    const chars = service.get('children');

                    if (chars) {
                        chars.forEach(char => {
                            if (char.uuid === uuid) {
                                retval = char;
                            }// if (char.uuid === uuid)
                        });
                    }// if (chars)
                }// if (!deviceDetail.discoveringChildren)
            }// if (service)

            return retval;
        }

Below is a function to extract descriptors

       extractDescriptor(char, uuid) {
            const { device, deviceDetails } = this.props;
            const { instanceId } = device;
            let retval;

            if (char) {
                const deviceDetail = deviceDetails.devices.get(instanceId);

                if (!deviceDetail.discoveringChildren) {
                    const descs = char.get('children');

                    if (descs) {
                        descs.forEach(desc => {
                            if (desc.uuid === uuid) {
                                retval = desc;
                            }// if (desc.uuid === uuid)
                        });
                    }// if (descs)
                }// if (!deviceDetail.discoveringChildren)
            }// if (char)

            return retval;
        }

I have written 4 custom services and they are call using the functions above in an identical way for all the services.
While the above functions do work, but for some reason they always only expand one service and the rest of the services using the same method have 'children' : undefined.

I have tried several times and using several methods. The first custom service expands and the rest are stuck in an endless loop as shown below. They never load and are stuck as such.

Can anyone help or suggest what might be wrong or if there is any other way for me to expand the characteristics and descriptors for my custom services ?

Thanks and regards,
Avi

Parents
  • Bumping this as I'm having the same issue:

    Connect to my device, try to open services and it just hangs like this. It never opens.

    Here is a system report:

    # nRFConnect System Report - 2022-12-21T12-23-19.373Z
    
    - System:     Apple Inc. MacBookAir10,1
    - BIOS:       Apple Inc. null
    - CPU:        1 x Apple M1 2.4 GHz 8 cores (8 physical)
    - Memory:     76.2 MB free of 8 GB total
    - Filesystem: /dev/disk3s1s1 (APFS) 228.3 GB 10.2% used
    
    - OS:         macOS (12.6.2) darwin x64
    
    - Versions
        - kernel: 21.6.0
        - git: 2.37.1
        - node: 14.16.0
        - python: 
        - python3: 3.9.6
        - nrf-device-lib-js: 0.4.4
        - nrf-device-lib: 0.10.3
        - nrfjprog DLL: 10.15.1
        - JLink: JLink_V7.84 
    
    - Connected devices:
        - 000682831929 PCA10040: /dev/tty.usbmodem0006828319291
    
    - Current device:
        - name:          nRF52 DK
        - serialNumber:  000682831929
        - cores:         1
        - website:       https://www.nordicsemi.com/Software-and-tools/Development-Kits/nRF52-DK
    

    This is on the standalone app v4.0.4. It used to work in the past I believe,

Reply
  • Bumping this as I'm having the same issue:

    Connect to my device, try to open services and it just hangs like this. It never opens.

    Here is a system report:

    # nRFConnect System Report - 2022-12-21T12-23-19.373Z
    
    - System:     Apple Inc. MacBookAir10,1
    - BIOS:       Apple Inc. null
    - CPU:        1 x Apple M1 2.4 GHz 8 cores (8 physical)
    - Memory:     76.2 MB free of 8 GB total
    - Filesystem: /dev/disk3s1s1 (APFS) 228.3 GB 10.2% used
    
    - OS:         macOS (12.6.2) darwin x64
    
    - Versions
        - kernel: 21.6.0
        - git: 2.37.1
        - node: 14.16.0
        - python: 
        - python3: 3.9.6
        - nrf-device-lib-js: 0.4.4
        - nrf-device-lib: 0.10.3
        - nrfjprog DLL: 10.15.1
        - JLink: JLink_V7.84 
    
    - Connected devices:
        - 000682831929 PCA10040: /dev/tty.usbmodem0006828319291
    
    - Current device:
        - name:          nRF52 DK
        - serialNumber:  000682831929
        - cores:         1
        - website:       https://www.nordicsemi.com/Software-and-tools/Development-Kits/nRF52-DK
    

    This is on the standalone app v4.0.4. It used to work in the past I believe,

Children
No Data
Related