Closed Bug 860166 Opened 12 years ago Closed 12 years ago

[Buri][PTS][HSP/HFP/OPP]Can not connected to PTS-HSP-VAL-yuanying for HSP/HFP/OPP profile cases test

Categories

(Firefox OS Graveyard :: Bluetooth, defect, P1)

ARM
Gonk (Firefox OS)
defect

Tracking

(blocking-b2g:tef+, firefox21 wontfix, firefox22 wontfix, firefox23 fixed, b2g18 fixed, b2g18-v1.0.0 wontfix, b2g18-v1.0.1 fixed)

RESOLVED FIXED
1.0.1 IOT1 (10may)
blocking-b2g tef+
Tracking Status
firefox21 --- wontfix
firefox22 --- wontfix
firefox23 --- fixed
b2g18 --- fixed
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- fixed

People

(Reporter: sync-1, Assigned: echou)

References

Details

(Whiteboard: [madrid][fixed-in-birch], QARegressExclude)

Attachments

(21 files, 8 obsolete files)

(deleted), application/pdf
Details
(deleted), text/plain
Details
(deleted), text/plain
Details
(deleted), text/plain
Details
(deleted), application/pdf
Details
(deleted), patch
Details | Diff | Splinter Review
(deleted), patch
Details | Diff | Splinter Review
(deleted), patch
Details | Diff | Splinter Review
(deleted), patch
Details | Diff | Splinter Review
(deleted), application/octet-stream
Details
(deleted), application/octet-stream
Details
(deleted), text/plain
Details
(deleted), text/plain
Details
(deleted), text/xml
Details
(deleted), text/xml
Details
(deleted), application/x-zip-compressed
Details
(deleted), patch
mrbkap
: review+
Details | Diff | Splinter Review
(deleted), patch
mrbkap
: review+
Details | Diff | Splinter Review
(deleted), application/x-zip-compressed
Details
(deleted), patch
Details | Diff | Splinter Review
(deleted), patch
Details | Diff | Splinter Review
Created an attachment (id=385957) HSP cases +++ This bug was initially created as a clone of Bug #437511 +++ Created an attachment (id=385878) log DEFECT DESCRIPTION: Can not connected to PTS-HSP-VAL-yuanying for HSP/HFP/OPP profile cases test REPRODUCING PROCEDURES: 1.Open PTS,run case,find can not connected to PTS-HSP-VAL-yuanying EXPECTED BEHAVIOUR: For KO,should can connected to PTS-HSP-VAL-yuanying,then run HFP cases ASSOCIATE SPECIFICATION: TEST PLAN REFERENCE: TOOLS AND PLATFORMS USED: USER IMPACT: REPRODUCING RATE: 5/5 For FT PR, Please list reference mobile's behavior: ++++++++++ end of initial bug #437511 description ++++++++++
Hi Eric, can you confirm HSP socket can be opened for v1.0.1?
Flags: needinfo?(echou)
Please help to clarify that HFP/OPP cannot get connected, it works for me.
Flags: needinfo?(sync-1)
Depends on: 851046
Component: Gaia::Bluetooth File Transfer → Bluetooth
(In reply to Shawn Huang from comment #1) > Hi Eric, can you confirm HSP socket can be opened for v1.0.1? Currently we don't create socket listening to HSP, so PTS tests of HSP must fail. The reason why we didn't have a HSP listening socket is that BluetoothHfpManager could listen to more than one socket at a time. After bug 851046 landed, we can start fixing this. I'll take this and nominate as a tef+ just like bug 823803.
Flags: needinfo?(echou)
Assignee: shuang → echou
blocking-b2g: --- → tef?
blocking-b2g: tef? → tef+
Flags: needinfo?(sync-1)
Created an attachment (id=385968) PTS guide
Attached file PTS guide (deleted) —
Created an attachment (id=385968) PTS guide
Sync from brother
Attached file logcat (deleted) —
Sync from brother
Sync from brother
Attached file log (deleted) —
Sync from brother
Sync from brother
Attached file log (deleted) —
Sync from brother
Created an attachment (id=390202) HSP cases
Attached file HSP cases (deleted) —
Created an attachment (id=390202) HSP cases
Whiteboard: [status: ETA 4/18]
Eric, can you provide an ETA here? Thanks!
(In reply to Johnny Stenback (:jst, jst@mozilla.com) from comment #14) > Eric, can you provide an ETA here? Thanks! The patch is almost ready.
This patch is quite similar as the patch of bug 823803. Because we have implemented the logic of Headset profile (e.g. dealing with command AT+CKPD=200) in BluetoothHfpManager.cpp, all we have to do is to maintain two server sockets for listening to HSP and HFP at the same time.
Attachment #738419 - Flags: review?(mrbkap)
Attachment #738419 - Flags: review?(gyeh)
Whiteboard: [status: ETA 4/18] → [status: ETA 4/18][madrid]
Comment on attachment 738419 [details] [diff] [review] patch 1: v1: Use two server sockets to listen to both HFP and HSP services Review of attachment 738419 [details] [diff] [review]: ----------------------------------------------------------------- r+ with nit addressed. ::: dom/bluetooth/BluetoothHfpManager.cpp @@ +1412,2 @@ > CloseScoSocket(); > + nit: Please move the above comments to here. Would that be clearer?
Attachment #738419 - Flags: review?(gyeh) → review+
Whiteboard: [status: ETA 4/18][madrid] → [status: ETA 4/18, needs r+ from mrbkap][madrid]
* Revised HSP related code based on Bluetooth HSP 1.2 spec
Attachment #738979 - Flags: review?(gyeh)
Comment on attachment 738979 [details] [diff] [review] patch 2: v1: Revise AT-command handler (AT+CKPD) Review of attachment 738979 [details] [diff] [review]: ----------------------------------------------------------------- The overall is good. Would be happy to see a new patch with handling both ATA and CHUP again. ::: dom/bluetooth/BluetoothHfpManager.cpp @@ +894,5 @@ > + } else { > + // Bluetooth HSP spec 4.4 ~ 4.6 > + // AG can decide the way dealing with AT+CKPD=200. Currently we don't > + // do anything but switching SCO. > + BluetoothScoManager* sco = BluetoothScoManager::Get(); nit: Suggest to use "NS_ENSURE_TRUE_VOID(sco);" here, then we don't need to indent the following lines. Or, you may want to add some warning message when we fail to get BluetoothScoManager. @@ +904,5 @@ > + mSocket->GetAddress(address); > + > + sco->Connect(address); > + } > + } I would recommend to support both answer and hangup a phone call, and a Sco link will be closed after hanging up, (like what we did for answering). For example: // If we have at least a call, then send ATA/CHUP // Otherwise, we switch sco if (mCurrentCallArray.Length() > 1) { if (!sStopSendingRingFlag) NotifyDialer(NS_LITERAL_STRING("ATA")); else NotifyDialer(NS_LITERAL_STRING("CHUP")); } else { BluetoothScoManager* sco = BluetoothScoManager::Get(); NS_ENSURE_TRUE_VOID(sco); if (sco->IsConnected()) { sco->Disconnect(); } else { nsAutoString address; mSocket->getAddress(address); sco->Connect(address); } } Well, it's just for your reference, any way to handle both ATA and CHUP are welcomed. And please correct me if it doesn't work. :( ::: dom/bluetooth/BluetoothScoManager.cpp @@ +205,1 @@ > NS_WARNING("Sco socket has been connected"); nit: Since the return value of IsConnected() is true whenever socket connection status is CONNECTED or CONNECTING, modify the warning message here would be better. @@ +294,5 @@ > +BluetoothScoManager::IsConnected() > +{ > + if (mSocket) { > + if (mSocket->GetConnectionStatus() == SocketConnectionStatus::SOCKET_CONNECTED || > + mSocket->GetConnectionStatus() == SocketConnectionStatus::SOCKET_CONNECTING) { Question 1: How about make a varialbe for |mSocket->GetConnectionStatus| and reuse it in if condition? Question 2: I don't think it would be a good idea for the case of returning true whenever the connection status is CONNECTING. nit: trailing-space.
Attachment #738979 - Flags: review?(gyeh)
> > The overall is good. Would be happy to see a new patch with handling both > ATA and CHUP again. > > ::: dom/bluetooth/BluetoothHfpManager.cpp > @@ +894,5 @@ > > + } else { > > + // Bluetooth HSP spec 4.4 ~ 4.6 > > + // AG can decide the way dealing with AT+CKPD=200. Currently we don't > > + // do anything but switching SCO. > > + BluetoothScoManager* sco = BluetoothScoManager::Get(); > > nit: Suggest to use "NS_ENSURE_TRUE_VOID(sco);" here, then we don't need to > indent the following lines. Or, you may want to add some warning message > when we fail to get BluetoothScoManager. > I'll add warning messages, but I rather use if(sco) instead of NS_ENSURE_TRUE_VOID(sco). If NS_ENSURE_TRUE_VOID(sco) is used, we won't respond with OK/ERROR to the remote device. > @@ +904,5 @@ > > + mSocket->GetAddress(address); > > + > > + sco->Connect(address); > > + } > > + } > > I would recommend to support both answer and hangup a phone call, and a Sco > link will be closed after hanging up, (like what we did for answering). > > For example: > // If we have at least a call, then send ATA/CHUP > // Otherwise, we switch sco > if (mCurrentCallArray.Length() > 1) { > if (!sStopSendingRingFlag) > NotifyDialer(NS_LITERAL_STRING("ATA")); > else > NotifyDialer(NS_LITERAL_STRING("CHUP")); > } else { > BluetoothScoManager* sco = BluetoothScoManager::Get(); > NS_ENSURE_TRUE_VOID(sco); > if (sco->IsConnected()) { > sco->Disconnect(); > } else { > nsAutoString address; > mSocket->getAddress(address); > sco->Connect(address); > } > } > > > > Well, it's just for your reference, any way to handle both ATA and CHUP are > welcomed. And please correct me if it doesn't work. :( > The behavior after received AT+CKPD is up to the AG, so I guess it should be fine. We'll see.
Target Milestone: --- → Madrid (19apr)
Comment on attachment 738419 [details] [diff] [review] patch 1: v1: Use two server sockets to listen to both HFP and HSP services Review of attachment 738419 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/bluetooth/BluetoothHfpManager.h @@ +128,5 @@ > + // Server sockets. Once an inbound connection is established, it will hand > + // over the ownership to mSocket, and get a new server socket while Listen() > + // is called. > + nsRefPtr<BluetoothSocket> mHfpSocket; > + nsRefPtr<BluetoothSocket> mHspSocket; Even knowing what Hfp and Hsp stand for, I find these two variable names way too close to each other. Could you rename them to something like: mHandsFreeSocket and mHeadSetSocket so there's less of a chance of confusing them?
Attachment #738419 - Flags: review?(mrbkap) → review+
* nits picked
Attachment #738419 - Attachment is obsolete: true
* all nits picked and problems fixed, except: >I would recommend to support both answer and hangup a phone call, and a Sco >link will be closed after hanging up, (like what we did for answering). >For example: >// If we have at least a call, then send ATA/CHUP >// Otherwise, we switch sco >if (mCurrentCallArray.Length() > 1) { > if (!sStopSendingRingFlag) > NotifyDialer(NS_LITERAL_STRING("ATA")); > else > NotifyDialer(NS_LITERAL_STRING("CHUP")); >} else { > BluetoothScoManager* sco = BluetoothScoManager::Get(); > NS_ENSURE_TRUE_VOID(sco); > if (sco->IsConnected()) { > sco->Disconnect(); > } else { > nsAutoString address; > mSocket->getAddress(address); > sco->Connect(address); > } >} It seems to work at first glance, however, imagine this scenario: (1) No Bluetooth connections (2) Make a call, so there is an ongoing phone call. (3) HS connects with AG, and AG receives AT+CKPD (Section 4.3 in Bluetooth HSP spec) In this case, CHUP would be sent to Dialer app and the ongoing phone call would be terminated by Dialer. Of course it's not what we expected, but we do want to end a call when we receive AT+CKPD=200 at any other time. To solve this, I add a flag mFirstCKPD to identify if this CKPD is the very first AT+CKPD=200. If it is, then don't notify dialer but just ignore this command.
Attachment #738979 - Attachment is obsolete: true
Attachment #739433 - Flags: review?(gyeh)
Comment on attachment 739433 [details] [diff] [review] patch 2: v2: Revise AT-command handler (AT+CKPD) Review of attachment 739433 [details] [diff] [review]: ----------------------------------------------------------------- Thanks for correcting me. This patch looks good to me. r+ with nits addressed. ::: dom/bluetooth/BluetoothHfpManager.cpp @@ +918,5 @@ > + // Three conditions have to be matched to come in here: > + // (1) Not sending RING indicator > + // (2) A SCO link exists > + // (3) This is the very first AT+CKPD=200 of this session > + // It is the case of Figure 4.3, Bluetooth HSP spec. Do nothing. Since the CKPD is ignored here, please add a warning message. It would be easier for us to debug. ::: dom/bluetooth/BluetoothScoManager.cpp @@ +202,5 @@ > } > > + if (mSocket->GetConnectionStatus() == SocketConnectionStatus::SOCKET_CONNECTED || > + mSocket->GetConnectionStatus() == SocketConnectionStatus::SOCKET_CONNECTING) { > + NS_WARNING("SCO connection exists or is being established"); Please see comment in the last review.
Attachment #739433 - Flags: review?(gyeh) → review+
Whiteboard: [status: ETA 4/18, needs r+ from mrbkap][madrid] → [status: ETA 4/18, needs r+ from mrbkap][madrid][fixed-in-birch]
Attached patch patch 1: for b2g18 (deleted) — Splinter Review
Hi sheriff, please use this patch for b2g18. Thank you.
Attachment #739430 - Attachment is obsolete: true
Attached patch patch 2: for b2g18 (deleted) — Splinter Review
Hi sheriff, please use this patch for b2g18. Thank you.
Attachment #739433 - Attachment is obsolete: true
As for BluetoothHfpManager.cpp on branch v1_0_1, it's too different from b2g18, and we're still waiting for the triage result to see if we can merge following bugs into v1_0_1: 01. bug827204 02. bug827255 03. bug823346 04. bug827230 05. bug828798 06. bug827212, patch 1 06. bug827212, patch 2 07. bug827266 08. bug828175 09. bug846647 10. bug825861 11. bug825851 12. bug835740 Once these bugs are allowed to be merged, we should be able to use the patch for b2g18. Otherwise, I'll provide a v1_0_1-specific patch.
Attached patch patch 1: for v1.0.1 (deleted) — Splinter Review
v1.0.1-specific patch
Attached patch patch 2: for v1.0.1 (deleted) — Splinter Review
v1.0.1-specific patch
Created an attachment (id=401242) all log KO ON 126+DT. Please refer to log_2013_05_02
Attached file all log (deleted) —
Created an attachment (id=401242) all log KO ON 126+DT. Please refer to log_2013_05_02
(In reply to sync-1 from comment #36) > Created attachment 744430 [details] > all log > > Created an attachment (id=401242) > all log > > KO ON 126+DT. > Please refer to log_2013_05_02 I couldn't extract the .rar correctly. In addition, please describe more detail of the problem you hit, such as which test case is failed.
Created an attachment (id=401316) sniffer log
Attached file sniffer log (deleted) —
Created an attachment (id=401316) sniffer log
Created an attachment (id=401318) kernel log
Attached file kernel log (deleted) —
Created an attachment (id=401318) kernel log
All HSP and HFP cases can not run pass. Because test phone can not connected to PTS!
Created an attachment (id=401320) logcat
Attached file logcat (deleted) —
Created an attachment (id=401320) logcat
I don't think current code can always cause connection failure. But it's better to get PTS logs for failure case. After patch applied, HSP shall be able to connect. Please confirm PIXIT configuration is correct. Please confirm (1). BD address (TSPX_bd_addr_iut) in pixit config is correct (2). Sometimes PTS cannot connect due to link key corrupted, please try to change TSPX_delete_link_key to TRUE, this can remove PTS local cached link key.
Flags: needinfo?(sync-1)
Created an attachment (id=401531) HFPlog
Flags: needinfo?(sync-1)
Attached file HFPlog (deleted) —
Created an attachment (id=401531) HFPlog
(In reply to comment #35) > Comment from Mozilla:I don't think current code can always cause connection > failure. > But it's better to get PTS logs for failure case. > After patch applied, HSP shall be able to connect. Please confirm PIXIT > configuration is correct. > Please confirm > (1). BD address (TSPX_bd_addr_iut) in pixit config is correct > (2). Sometimes PTS cannot connect due to link key corrupted, please try to > change TSPX_delete_link_key to TRUE, this can remove PTS local cached link key. (1)BT address is correct (2)I choose TSPX_delete_link_key to TRUE in HSP and HFP pixit And also can not connected to PTS,I have upload HSP and HFP log ,If any question,please reply me. Thanks!
Created an attachment (id=401532) HSPlog
Attached file HSPlog (deleted) —
Created an attachment (id=401532) HSPlog
xml log can only tell VERDICT is "INCONC". Can you upload your HSP logfile.log?
(In reply to comment #41) > Comment from Mozilla:xml log can only tell VERDICT is "INCONC". Can you upload > your HSP logfile.log? My loggile.log all show blank,how should I catch this log?
Flags: needinfo?(sync-1)
Created an attachment (id=401701) HSP log
Attached file HSP log (deleted) —
Created an attachment (id=401701) HSP log
Marking as QARegressExclude. Unable to test due to not having the correct test tools to test this.
Whiteboard: [status: ETA 4/18, needs r+ from mrbkap][madrid][fixed-in-birch] → [status: ETA 4/18, needs r+ from mrbkap][madrid][fixed-in-birch], QARegressExclude
(In reply to comment #44) > Comment from Mozilla:Marking as QARegressExclude. Unable to test due to not > having the correct test tools to test this. which test tool?we all use PTS tool to test.
Just found out the root cause. With current implementation, we would not call Listen() again when GetDeviceServiceChannel() failed. So, if you try to test HSP before HFP, connection request would be rejected by PTS because only HSP is supported. After that, both HFP and HSP would not be able to be connected with. However, Bluetooth still works when users tend to connect to a device without correct services, such as trying to send a file to a headset. We need to fix this in all branches. I'm going to reopen this bug, I'll make a patch, and try to solve it by next Monday.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
typo: > However, Bluetooth still works when users tend to connect to a device s/tend/not tend > without correct services, such as trying to send a file to a headset.
Re-milestoning for completion by 5/10, now that this has reopened.
Target Milestone: 1.0.1 Madrid (19apr) → 1.0.1 IOT1 (10may)
This patch can fix the problem mentioned in comment 57. Bluetooth now could recover from a connection failure.
Attachment #745816 - Flags: review?(gyeh)
BluetoothProfileManagerBase is a base class of Bluetooth profile managers. It will be a generic interface declaring basic functions that all profile managers should implement, such as Connect(), Disconnect() and IsConnected(). Currently there is only one callback function OnGetServiceChannel() declared, which will be called once BluetoothService::GetServiceChannel() is done.
Attachment #745816 - Attachment is obsolete: true
Attachment #745816 - Flags: review?(gyeh)
Attachment #746256 - Flags: review?(gyeh)
Things we have done in this patch: 1. Make BluetoothHfpManager/BluetoothOppManager implement BluetoothProfileManagerBase 2. Add function BluetoothService::GetServiceChannel() 3. Once GetServiceChannel() is done, callback Bluetooth*Manager::OnGetServiceChannel() will be invoked 4. Remove unused function BluetoothService::GetSocketViaService()
Attachment #746257 - Flags: review?(gyeh)
Comment on attachment 746256 [details] [diff] [review] patch 3: v2: create interface BluetoothProfileManagerBase Hi Blake, could you help with reviewing this patch? Thanks.
Attachment #746256 - Flags: review?(gyeh) → review?(mrbkap)
Comment on attachment 746257 [details] [diff] [review] patch 4: v1: New mechanism for establishing outboung Bluetooth connections Hi Blake, could you help with reviewing this patch? Thanks.gyeh@mozilla.com
Attachment #746257 - Flags: review?(gyeh) → review?(mrbkap)
Attachment #746256 - Flags: review?(mrbkap) → review+
Comment on attachment 746257 [details] [diff] [review] patch 4: v1: New mechanism for establishing outboung Bluetooth connections Review of attachment 746257 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/bluetooth/BluetoothHfpManager.cpp @@ +974,5 @@ > > + if (NS_FAILED(bs->GetServiceChannel(aDevicePath, uuid, this))) { > + BluetoothValue v; > + nsString replyError; > + replyError.AssignLiteral("GetServiceChannel failed"); Please do this as: NS_NAMED_LITERAL_STRING(replyError, "GetServiceChannel failed"); @@ +1448,5 @@ > + nsString replyError; > + > + if (aChannel < 0) { > + replyError.AssignLiteral("DeviceChannelRetrievalError"); > + DispatchBluetoothReply(mRunnable, v, replyError); Instead of using an explicit nsString, just use NS_LITERAL_STRING("DeviceChannelRetrievalError"). That way you can get rid of replyError. @@ +1457,5 @@ > + > + nsCString address; > + address.Append(NS_ConvertUTF16toUTF8(aDeviceAddress)); > + > + if (!mSocket->Connect(address, aChannel)) { Just pass the result of NS_ConvertUTF16toUTF8(aDeviceAddress) directly to mSocket->Connect. ::: dom/bluetooth/BluetoothOppManager.cpp @@ +1487,5 @@ > + MOZ_ASSERT(NS_IsMainThread()); > + MOZ_ASSERT(mRunnable); > + > + BluetoothValue v; > + nsString replyError; The comments in the Hfp manager apply equally to this file as well. ::: dom/bluetooth/linux/BluetoothDBusService.cpp @@ +2546,2 @@ > errorStr.AssignLiteral("Unknown profile"); > DispatchBluetoothReply(aRunnable, v, errorStr); Instead of the explicit string variable, just pass NS_LITERAL_STRING("Unknown profile") through. @@ +2704,4 @@ > return NS_ERROR_FAILURE; > } > > + r.forget(); This leaks, don't forget(). @@ +2731,4 @@ > return NS_ERROR_FAILURE; > } > > + r.forget(); This leaks, don't forget().
Attachment #746257 - Flags: review?(mrbkap)
* problems solved
Attachment #746257 - Attachment is obsolete: true
Attachment #747277 - Flags: review?(mrbkap)
Attachment #747277 - Flags: review?(mrbkap) → review+
When run HFP/HSP PTS cases,Still failed to connected to PTS,use PTS 4.5.2 because can not install 4.5.3. You can refer to log(log_0509). AU_LINUX_GECKO_ICS_STRAWBERRY_V1.01.00.01.019.094 Firefox os v1.0.1 Mozilla build ID:20130502070201
Attached file log_0509 (deleted) —
When run HFP/HSP PTS cases,find also can not connected to PTS,use PTS 4.5.2 because can not install 4.5.3.You can refer to log(log_0509). Thanks!
Based Comment 69, is this result based on applied patch 3, patch 4?
Hello Eric, is there any additional work need to do except patch 3, patch 4? Like gaia?
Flags: needinfo?(echou)
Attached patch patch 4: final: for b2g18 (obsolete) (deleted) — Splinter Review
* patch 4 for b2g18
Attached patch patch 4: final: for b2g18_v1_0_1 (obsolete) (deleted) — Splinter Review
* patch 4 for b2g18_v1_0_1
Attached patch patch 4: final: for b2g18 (deleted) — Splinter Review
* patch 4 for b2g18 (updated. The commit summary of the former patch is incorrect)
Attachment #747866 - Attachment is obsolete: true
* patch 4 for b2g18-v1_0_1 (updated. The commit summary of the former patch is incorrect)
Attachment #747867 - Attachment is obsolete: true
Whiteboard: [status: ETA 4/18, needs r+ from mrbkap][madrid][fixed-in-birch], QARegressExclude → [status: awaiting uplift][madrid][fixed-in-birch], QARegressExclude
Status: REOPENED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: