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

Parents
  • 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);
    
Reply
  • 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);
    
Children
No Data