Multiple L2CAP channels on iOS
up vote
0
down vote
favorite
I'm trying to open two L2CAP channels between iPhone and app running on MacOS.
MacOS app published two channels: PSM=193
and PSM=194
.
I open those channels on iOS app:
peripheral.openL2CAPChannel(CBL2CAPPSM(193))
peripheral.openL2CAPChannel(CBL2CAPPSM(194))
And then I get successful delegate callbacks:
public func peripheral(_ peripheral: CBPeripheral,
didOpen channel: CBL2CAPChannel?,
error: Error?) {
print("Opened channel PSM is: (channel.psm)")
// Keep strong reference to opened channel
openedChannels.append(channel)
}
What's interesting though is the output...:
Opened channel PSM is: 193
Opened channel PSM is: 193 // !?!
Delegate callback is called with different channel instance but with the same PSM.
On the MacOS app, I do get callback that channel 194
was opened though. However, when I write some data to the 194
channel, it's actually send to the first 193
channel that I opened.
Am I doing something wrong or is it a CoreBluetooth bug?
ios core-bluetooth ios-bluetooth l2cap
add a comment |
up vote
0
down vote
favorite
I'm trying to open two L2CAP channels between iPhone and app running on MacOS.
MacOS app published two channels: PSM=193
and PSM=194
.
I open those channels on iOS app:
peripheral.openL2CAPChannel(CBL2CAPPSM(193))
peripheral.openL2CAPChannel(CBL2CAPPSM(194))
And then I get successful delegate callbacks:
public func peripheral(_ peripheral: CBPeripheral,
didOpen channel: CBL2CAPChannel?,
error: Error?) {
print("Opened channel PSM is: (channel.psm)")
// Keep strong reference to opened channel
openedChannels.append(channel)
}
What's interesting though is the output...:
Opened channel PSM is: 193
Opened channel PSM is: 193 // !?!
Delegate callback is called with different channel instance but with the same PSM.
On the MacOS app, I do get callback that channel 194
was opened though. However, when I write some data to the 194
channel, it's actually send to the first 193
channel that I opened.
Am I doing something wrong or is it a CoreBluetooth bug?
ios core-bluetooth ios-bluetooth l2cap
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm trying to open two L2CAP channels between iPhone and app running on MacOS.
MacOS app published two channels: PSM=193
and PSM=194
.
I open those channels on iOS app:
peripheral.openL2CAPChannel(CBL2CAPPSM(193))
peripheral.openL2CAPChannel(CBL2CAPPSM(194))
And then I get successful delegate callbacks:
public func peripheral(_ peripheral: CBPeripheral,
didOpen channel: CBL2CAPChannel?,
error: Error?) {
print("Opened channel PSM is: (channel.psm)")
// Keep strong reference to opened channel
openedChannels.append(channel)
}
What's interesting though is the output...:
Opened channel PSM is: 193
Opened channel PSM is: 193 // !?!
Delegate callback is called with different channel instance but with the same PSM.
On the MacOS app, I do get callback that channel 194
was opened though. However, when I write some data to the 194
channel, it's actually send to the first 193
channel that I opened.
Am I doing something wrong or is it a CoreBluetooth bug?
ios core-bluetooth ios-bluetooth l2cap
I'm trying to open two L2CAP channels between iPhone and app running on MacOS.
MacOS app published two channels: PSM=193
and PSM=194
.
I open those channels on iOS app:
peripheral.openL2CAPChannel(CBL2CAPPSM(193))
peripheral.openL2CAPChannel(CBL2CAPPSM(194))
And then I get successful delegate callbacks:
public func peripheral(_ peripheral: CBPeripheral,
didOpen channel: CBL2CAPChannel?,
error: Error?) {
print("Opened channel PSM is: (channel.psm)")
// Keep strong reference to opened channel
openedChannels.append(channel)
}
What's interesting though is the output...:
Opened channel PSM is: 193
Opened channel PSM is: 193 // !?!
Delegate callback is called with different channel instance but with the same PSM.
On the MacOS app, I do get callback that channel 194
was opened though. However, when I write some data to the 194
channel, it's actually send to the first 193
channel that I opened.
Am I doing something wrong or is it a CoreBluetooth bug?
ios core-bluetooth ios-bluetooth l2cap
ios core-bluetooth ios-bluetooth l2cap
asked 2 days ago
msmialko
225925
225925
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53410362%2fmultiple-l2cap-channels-on-ios%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown