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

MasterEmulator - how to setupPipes?

Hello could anyone help me how to setup pipes for my characteristic, i need to recieve/transmit data to UUID of my characteristic, and recieve/trasmit to ClientcharacteristicConfiguration but iam not sure how to setup pipes, here is my service and characteristic: image description thanks for help

  • Ok I did a bit research, and first I need to enable CCCD for me characteristic, still dont know how to do it via API, i guess i need a pipe for it, still dont know how to setup it correcly i think

  • Hi, in MasterEmulator you need to configure pipes for all characteristics/descriptors you want to interact with. The two best resources to see how it is used is to look at the example projects and to look at PipeTypes in the .chm help file.

  • thank you for answer, I didn't now how to configure the pipes, now I know if i set correct pipe type it will enable the services, for example for my characteristic i have Write, Indicate, and when i set the pipe type to RevieveWithAck it will auto activate my characteistic. Just now i dont know how to get value of this indicate, because my characteristic doesnt have read Property i cant simply use RequestData(), but dont know yet how to configure events by emulator API

  • Take a look at the

    PipeSetup.cs

    in the HidDemo under C:\Program Files (x86)\Nordic Semiconductor\Master Emulator\2.1.13.14\Example code. It has an example using SetupAddCharacteristicDescriptor.

  • One additional gotcha for future readers:

    If you are specifying your custom service with a full 128-bit (16byte) UUID, your subsequent characteristics ALSO need to be specified with a full 128-bit UUID. This seems inconsistent with the Nordic softdevice firmware api, where you specify the base service as full 128-bit, then use 2-byte attribute UUIDs, but whatever.

    So working from the Nordic example code found in nrfuart::pipesetup.cs:

       /* GAP service */
        BtUuid uartOverBtleUuid = new BtUuid("6e400001b5a3f393e0a9e50e24dcca9e");
        masterEmulator.SetupAddService(uartOverBtleUuid, PipeStore.Remote);
    
        /* UART RX characteristic (RX from peripheral's viewpoint) */
    
        BtUuid uartRxUuid = new BtUuid("6e400002b5a3f393e0a9e50e24dcca9e");
        int uartRxMaxLength = 20;
        byte[] uartRxData = null;
        masterEmulator.SetupAddCharacteristicDefinition(uartRxUuid, uartRxMaxLength,
            uartRxData);
    
Related