This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DataReceived Not Firing

I'm trying to use MasterEmulator with the service from BLE Characteristics, a beginner's tutorial and am not able to get the temperature data because the Datareceived event does not fire. Here is how I have the pipe setup:

    public void PerformPipeSetup()
    {
        BtUuid BtleUuid = new BtUuid("23d113ef5f782315deef12120df00000");
        masterEmulator.SetupAddService(BtleUuid, PipeStore.Remote);

        //BtUuid notifyUuid = new BtUuid("23d113ef5f782315deef1212efbe0000");
        BtUuid notifyUuid = new BtUuid("BEEF");
        int notifyMaxLength = 20;
        byte[] notifyData = null;
        masterEmulator.SetupAddCharacteristicDefinition(notifyUuid, notifyMaxLength, notifyData);
   
        pipe1 = masterEmulator.SetupAssignPipe(PipeType.Receive);
        //pipe2 = masterEmulator.SetupAssignPipe(PipeType.ReceiveRequest);
    }

and here is what I see in nRFConnect

image description

I noticed that I have to toggle notifications in nRFConnect to get notified. Do I have to do something similar to get this working with MasterEmulator? Do I need to use SetupAssignPipe for the Read and Write?

Thanks

Parents
  • I was able to get this to work by using the following in PipeSetup:

            BtUuid BtleUuid = new BtUuid("0000F00D1212EFDE1523785FEF13D123");
            masterEmulator.SetupAddService(BtleUuid, PipeStore.Remote);
    
            BtUuid notifyUuid = new BtUuid("0000BEEF1212EFDE1523785FEF13D123");
            int notifyMaxLength = 20;
            byte[] notifyData = null;
            masterEmulator.SetupAddCharacteristicDefinition(notifyUuid, notifyMaxLength, notifyData);
    
            pipe1 = masterEmulator.SetupAssignPipe(PipeType.Receive);
            pipe2 = masterEmulator.SetupAssignPipe(PipeType.ReceiveRequest);
    

    OnDataReceived is now firing.

Reply
  • I was able to get this to work by using the following in PipeSetup:

            BtUuid BtleUuid = new BtUuid("0000F00D1212EFDE1523785FEF13D123");
            masterEmulator.SetupAddService(BtleUuid, PipeStore.Remote);
    
            BtUuid notifyUuid = new BtUuid("0000BEEF1212EFDE1523785FEF13D123");
            int notifyMaxLength = 20;
            byte[] notifyData = null;
            masterEmulator.SetupAddCharacteristicDefinition(notifyUuid, notifyMaxLength, notifyData);
    
            pipe1 = masterEmulator.SetupAssignPipe(PipeType.Receive);
            pipe2 = masterEmulator.SetupAssignPipe(PipeType.ReceiveRequest);
    

    OnDataReceived is now firing.

Children
No Data
Related