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

Specify Port for L2CAP Communication

Hi all,

I am trying to specify a fixed port for a L2CAP connection on the nRF51822. The client is a Linux box running bluez (which has BLE support). The client software is designed in Qt, which exposes the underlying bluetooth in a cross platform way.

My goal is to set up a L2CAP connection to send and receive data since Qt does not have full BLE support yet but does have L2CAP which, for my application, is more suitable as it is not a traditional BLE sensor app.

So far I can:

  1. Send L2CAP data to the Master Control using example code Ole graciously gave to me. The data shows up in the Log file correctly.
  2. Scan and identify the nRF51822 using Qt API calls.

What I am unsure about is how to specify a fixed L2CAP port number on the nRF51822 side to establish communication.

Thanks in advance,

Nick

Parents
  • A connection in BLE doesn't really have anything to do with a service, and you can create a connection without actually using any service, just to do L2CAP transfers.

    With the S110 there isn't any other way to transfer L2CAP data than what Pål says, by registering a channel with sd_ble_l2cap_cid() and then send data with sd_ble_l2cap_tx().

    Unfortunately, we cannot really help you with how to read do this from the other end, through Qt's interfaces, as we don't know them. I'd recommend you to just try to first initiate a connection and only when you're successfully able to do so try to actually receive data.

    To be honest, I suspect that this L2CAP API will not be usable for BLE at all. I believe your current best bet to talk to a BLE device on Linux is the C API of BlueZ directly, as stated here.

Reply
  • A connection in BLE doesn't really have anything to do with a service, and you can create a connection without actually using any service, just to do L2CAP transfers.

    With the S110 there isn't any other way to transfer L2CAP data than what Pål says, by registering a channel with sd_ble_l2cap_cid() and then send data with sd_ble_l2cap_tx().

    Unfortunately, we cannot really help you with how to read do this from the other end, through Qt's interfaces, as we don't know them. I'd recommend you to just try to first initiate a connection and only when you're successfully able to do so try to actually receive data.

    To be honest, I suspect that this L2CAP API will not be usable for BLE at all. I believe your current best bet to talk to a BLE device on Linux is the C API of BlueZ directly, as stated here.

Children
Related