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)

ARM
Gonk (Firefox OS)
defect
Not set
normal

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.
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: allstars.chh → dlee
Depends on: 1083651
Attached patch WIP Patch (obsolete) — Splinter Review
This is based on modification of Bug 1083651
Attachment #8506048 - Attachment is obsolete: true
Attachment #8506762 - Flags: review?(allstars.chh)
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-
Attached patch Patch v2 (obsolete) — Splinter Review
Change error code to enum
Attachment #8506762 - Attachment is obsolete: true
Attachment #8508534 - Flags: review?(allstars.chh)
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)
Attached patch patch v3 (obsolete) — Splinter Review
Attachment #8508534 - Attachment is obsolete: true
Attachment #8508588 - Flags: review?(allstars.chh)
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)
Attachment #8508588 - Attachment is obsolete: true
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)
Attached patch Part1. Support error code (obsolete) — Splinter Review
Attachment #8510255 - Flags: review?(allstars.chh)
Attached patch Part2. Error Code WEBIDL (obsolete) — Splinter Review
Attachment #8510257 - Flags: review?(allstars.chh)
Attached patch Part1. WebIDL change v2 (obsolete) — Splinter Review
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)
Attached patch Part2. Support error code (obsolete) — Splinter Review
Attachment #8513209 - Flags: review?(allstars.chh)
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+
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+
Attachment #8510249 - Flags: review?(allstars.chh) → review+
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 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-
Attached patch Part1. WebIDL change v3 (obsolete) — Splinter Review
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)
Attached patch Part2. Support error code v2 (obsolete) — Splinter Review
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)
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 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).
(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
Attachment #8515794 - Flags: review?(bugs) → review+
Attached patch Rebased patch v1Splinter Review
Attachment #8515794 - Attachment is obsolete: true
Attachment #8515797 - Attachment is obsolete: true
Attachment #8516488 - Flags: review+
Keywords: checkin-needed
ni? myself to land the nfcd patch.
Flags: needinfo?(allstars.chh)
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.1 S8 (7Nov)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: