Closed
Bug 1047233
Opened 11 years ago
Closed 11 years ago
B2G NFC: handler the errorMsg in NfcService and list errorMsg in WebIDL.
Categories
(Firefox OS Graveyard :: NFC, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
2.1 S8 (7Nov)
People
(Reporter: allstars.chh, Assigned: dimi)
References
Details
(Whiteboard: [good first bug])
Attachments
(2 files, 10 obsolete files)
Right now the error message are all listed in nfc_consts.js, we should list the possible error message in the WebIDL.
| Reporter | ||
Updated•11 years ago
|
Blocks: b2g-nfc-privilege
| Reporter | ||
Updated•11 years ago
|
Summary: B2G NFC: list the error message in NFC.webidl → B2G NFC: handler the errorMsg in NfcService and list errorMsg in WebIDL.
Whiteboard: [good first bug]
| Assignee | ||
Updated•11 years ago
|
Assignee: allstars.chh → dlee
| Assignee | ||
Comment 1•11 years ago
|
||
| Assignee | ||
Comment 2•11 years ago
|
||
This is based on modification of Bug 1083651
Attachment #8506048 -
Attachment is obsolete: true
Attachment #8506762 -
Flags: review?(allstars.chh)
| Reporter | ||
Comment 3•11 years ago
|
||
Comment on attachment 8506762 [details] [diff] [review]
Add NFC Error code in WebIDL patch v1
Review of attachment 8506762 [details] [diff] [review]:
-----------------------------------------------------------------
use 'enum'.
Attachment #8506762 -
Flags: review?(allstars.chh) → review-
| Assignee | ||
Comment 4•11 years ago
|
||
Change error code to enum
Attachment #8506762 -
Attachment is obsolete: true
Attachment #8508534 -
Flags: review?(allstars.chh)
| Reporter | ||
Comment 5•11 years ago
|
||
Comment on attachment 8508534 [details] [diff] [review]
Patch v2
Review of attachment 8508534 [details] [diff] [review]:
-----------------------------------------------------------------
Should we also modify NfcService or NfcMessageHandler so it will report errorMsg to Nfc.js directly?
In that case Nfc.js doesn't have to const those error code nor error message.
::: dom/webidl/MozNFC.webidl
@@ +3,5 @@
> * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
>
> /* Copyright © 2013 Deutsche Telekom, Inc. */
>
> +enum NfcErrorCode {
NfcErrorMessage
@@ +8,5 @@
> + "success",
> + "ioerror",
> + "timeout",
> + "busy",
> + "errorconnect",
use either
errorConnect
or
ErrorConnect
will be easier to understand.
Attachment #8508534 -
Flags: review?(allstars.chh)
| Assignee | ||
Comment 6•11 years ago
|
||
Attachment #8508534 -
Attachment is obsolete: true
Attachment #8508588 -
Flags: review?(allstars.chh)
| Assignee | ||
Comment 7•11 years ago
|
||
Comment on attachment 8508588 [details] [diff] [review]
patch v3
Remove review? for now because I will upload another patch with using WebIDL error message in gecko
Attachment #8508588 -
Flags: review?(allstars.chh)
| Assignee | ||
Updated•11 years ago
|
Attachment #8508588 -
Attachment is obsolete: true
| Assignee | ||
Comment 8•11 years ago
|
||
1. Remove bad session id from error code because this is gecko error.
2. Also change SUCCESS to -1 because WebIDL enum error array only contain error string
Attachment #8510249 -
Flags: review?(allstars.chh)
| Assignee | ||
Comment 9•11 years ago
|
||
Attachment #8510255 -
Flags: review?(allstars.chh)
| Assignee | ||
Comment 10•11 years ago
|
||
Attachment #8510257 -
Flags: review?(allstars.chh)
| Assignee | ||
Comment 11•11 years ago
|
||
Attachment #8510255 -
Attachment is obsolete: true
Attachment #8510257 -
Attachment is obsolete: true
Attachment #8510255 -
Flags: review?(allstars.chh)
Attachment #8510257 -
Flags: review?(allstars.chh)
Attachment #8513208 -
Flags: review?(allstars.chh)
| Assignee | ||
Comment 12•11 years ago
|
||
Attachment #8513209 -
Flags: review?(allstars.chh)
| Reporter | ||
Comment 13•11 years ago
|
||
Comment on attachment 8513208 [details] [diff] [review]
Part1. WebIDL change v2
Review of attachment 8513208 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/webidl/MozNFC.webidl
@@ +4,5 @@
>
> /* Copyright © 2013 Deutsche Telekom, Inc. */
>
> +enum NfcErrorMessage {
> + "IOError",
fix indent to 2 spaces.
Attachment #8513208 -
Flags: review?(allstars.chh) → review+
| Reporter | ||
Comment 14•11 years ago
|
||
Comment on attachment 8513209 [details] [diff] [review]
Part2. Support error code
Review of attachment 8513209 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/nfc/gonk/NfcMessageHandler.cpp
@@ +36,5 @@
> static const char* kTechLostNotification = "TechLostNotification";
> static const char* kHCIEventTransactionNotification =
> "HCIEventTransactionNotification";
>
> +static const int kErrorCodeToErrorStringOffset = 1;
could be just kErrorMsgOffset.
@@ +178,5 @@
> bool
> NfcMessageHandler::ReadNDEFResponse(const Parcel& aParcel, EventOptions& aOptions)
> {
> + int errorCode = aParcel.readInt32();
> + int seesionId = aParcel.readInt32();
sessionId
::: dom/nfc/gonk/NfcMessageHandler.h
@@ +42,5 @@
> bool ReadNDEFMessage(const android::Parcel& aParcel, EventOptions& aOptions);
> bool WriteNDEFMessage(android::Parcel& aParcel, const CommandOptions& aOptions);
>
> private:
> + nsString ConvertErrCodetoErrMsg(int aErrCode);
CovertToErrorMsg is enough
Attachment #8513209 -
Flags: review?(allstars.chh) → review+
| Reporter | ||
Updated•11 years ago
|
Attachment #8510249 -
Flags: review?(allstars.chh) → review+
| Assignee | ||
Comment 15•11 years ago
|
||
Comment on attachment 8513208 [details] [diff] [review]
Part1. WebIDL change v2
Add r? to smug for adding NFC error code to webIDL.
Indent nits mentioned by yoshi will be fixed in next patch.
Attachment #8513208 -
Flags: review+ → review?(bugs)
Comment 16•11 years ago
|
||
Comment on attachment 8513208 [details] [diff] [review]
Part1. WebIDL change v2
So we add enum NfcErrorMessage but don't use it anywhere?
Should NfcEventOptions.errorMsg use type NfcErrorMessage ?
And if you need "" to indicate no error, just add it to the enum.
Attachment #8513208 -
Flags: review?(bugs) → review-
| Assignee | ||
Comment 17•11 years ago
|
||
This patch address the following comment
1. use "" to indicate success
2. use type NfcErrorMessage for NfcEventOptions.errorMsg
Because we are moving NFC API from certified to privileged, so these error codes are for future use, no one is using it now.
Attachment #8513208 -
Attachment is obsolete: true
Attachment #8515794 -
Flags: review?(bugs)
| Assignee | ||
Comment 18•11 years ago
|
||
Hi Yoshi,
The implementation is changed because of WebIDL according to Comment 16.
Could you help review again ? Thanks !
Attachment #8513209 -
Attachment is obsolete: true
Attachment #8515797 -
Flags: review?(allstars.chh)
| Reporter | ||
Comment 19•11 years ago
|
||
Comment on attachment 8515797 [details] [diff] [review]
Part2. Support error code v2
Review of attachment 8515797 [details] [diff] [review]:
-----------------------------------------------------------------
Update the patch subject.
Attachment #8515797 -
Flags: review?(allstars.chh) → review+
Comment 20•11 years ago
|
||
Comment on attachment 8515794 [details] [diff] [review]
Part1. WebIDL change v3
What is the status used for if we now just set errorMsg (based on part 2).
| Assignee | ||
Comment 21•11 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #20)
> Comment on attachment 8515794 [details] [diff] [review]
> Part1. WebIDL change v3
>
> What is the status used for if we now just set errorMsg (based on part 2).
Originally |status| is used for both initialize notification callback from nfc daemon and error status for different request.
Now we move error status to errorMsg and keep using |status| for initialize notification.
http://dxr.mozilla.org/mozilla-central/source/dom/nfc/gonk/NfcMessageHandler.cpp#234
Updated•11 years ago
|
Attachment #8515794 -
Flags: review?(bugs) → review+
| Assignee | ||
Comment 22•11 years ago
|
||
| Assignee | ||
Comment 23•11 years ago
|
||
Attachment #8515794 -
Attachment is obsolete: true
Attachment #8515797 -
Attachment is obsolete: true
Attachment #8516488 -
Flags: review+
| Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
| Reporter | ||
Comment 24•11 years ago
|
||
Keywords: checkin-needed
Comment 26•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.1 S8 (7Nov)
| Reporter | ||
Comment 27•11 years ago
|
||
Flags: needinfo?(allstars.chh)
| Reporter | ||
Updated•11 years ago
|
No longer blocks: b2g-nfc-privilege
| Reporter | ||
Updated•11 years ago
|
Blocks: b2g-nfc-privilege
You need to log in
before you can comment on or make changes to this bug.
Description
•