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

Getting nRFConnect and the nRF51 working with Visual Studio?

I'm very new to nRF BLe coding and I am having trouble finding what I need to proceed.

I have some PC Boards with inputs and I can connect to them through nRFConnect Bluetooth Low Energy app fine and then push buttons and see in the Log file the buttons I have pushed.

It says I have connected on COM 3 and everything seems to be working peachy.The BYTEs come through as I push buttons.

The trouble is I need those push buttons to trigger things in Unity (basically a C# project in Visual Studio).

I tried to listen on COM 3 to see if I can get the BYTEs being sent to the nRF Connect program but of course only 1 program can listen on a COM port at a time so it isn't possible,

I have installed VisualGDB but dont know how to get any examples in Visual Studio to mimic what nRF connect is doing and connect to the same nRF51 device.

I have read that I might want to monitor a log file to get the data but that seems to be a little bit clunky and there must be a more elegant solution for me to connect to the device and get the inputs into Visual Studio.

Would anybody be kind enough to point me in the right direction on what I should be doing to learn a little more on connecting to the dongle, then connecting to my boards so I can read their BYTEs?

Any help would be greatly appreciated.

Lindsay.

Parents Reply
  • I think I am honing in on my issue.

    I am trying to connect a basic MIDI device, and I can see in nrfconnect that it manages to get the service and from that it then manages to get the characteristic.

    To try and do the same in pc-ble-driver I manage to connect and then on 
    ble_db_discovery_evt_register 
    I try and register out with
       btn_uuid.uuid = 0xFFE0; 
    and I get - BLE_DB_DISC:INFO:Service UUID 0xffe0 Not found

    I try 
       btn_uuid.uuid = 0x180A;
    but I dont think I am getting the characteristics that I want for MIDI so when I then try and follow up with a GATTC write  BLE_GATT_OP_WRITE_REQ I get nothing.

    I feel I am so close, I have the device connecting but I cant get the correct characteristics out.
    Is there a way that I can see what nrfConnect BLE is doing to do the same?

Children
Related