Closed
Bug 830264
Opened 11 years ago
Closed 11 years ago
B2G CDMA: Support SMS
Categories
(Core :: DOM: Device Interfaces, defect)
Tracking
()
RESOLVED
FIXED
mozilla22
People
(Reporter: chucklee, Assigned: chucklee)
References
Details
Attachments
(6 files, 12 obsolete files)
2.14 KB,
patch
|
vicamo
:
review+
|
Details | Diff | Splinter Review |
4.46 KB,
patch
|
Details | Diff | Splinter Review | |
4.21 KB,
patch
|
Details | Diff | Splinter Review | |
31.17 KB,
patch
|
Details | Diff | Splinter Review | |
14.00 KB,
patch
|
vicamo
:
review+
|
Details | Diff | Splinter Review |
6.66 KB,
patch
|
Details | Diff | Splinter Review |
Standard : 3GPP2 C.S0015-B v2.0 http://www.3gpp2.org/public_html/specs/C.S0015-B_v2.0_051006.pdf Current progress 1. Receive 1.1. Support encoding : Unicode, 7-bit ASCII, IA5, IS-91, GSM 7-bit default alphabet 1.2. Support both segmented/un-segmented message 2. Deliver 2.1 Support encoding : Unicode, 7-bit ASCII 2.2 Support un-segmented message
Assignee | ||
Updated•11 years ago
|
Blocks: b2g-ril-cdma
Assignee | ||
Comment 1•11 years ago
|
||
RIL Parcel Format, tailing '*' indicates parameter defined in C.S0015 Type Parameter ===== Service Info Part ============= Integer Teleservice Identity* Byte Service Present Indicator 1 : Broadcast 0 : P2P SMS if Teleservice Identity is non-zero, ACK otherwise Integer Service Category* ===== Address Part ============= Integer Digit Mode of Address* Integer Number Mode of Address* Integer Number Type of Address* Integer Number Plan of Address* Byte Length of Address* Byte*n Address, one digit per Byte* ===== Subaddress Part ============= Integer Number Type of Subaddress* Integer Odd of Subaddress* Byte Length of Subaddress* Byte*n Subaddress, one digit per Byte* ===== Subparameter Part ============= Byte*n Subparameter data*
Assignee | ||
Comment 2•11 years ago
|
||
On segmented message, Teleservice ID set to 0x1005(WEMT) instead of 0x1002(WMT/SMS). User data header is embedded into user data(subparameter 0x01), between NUM_FIELDS and user data payload. Structure of subparameter 0x01: +--------+--------+----------+------------+-------------+-----------+ | 8 bits | 8 bits | 5 bits | 8 bits | n bits | m bits | +--------+--------+----------+------------+-------------+-----------+ | ID | Length | Encoding | NUM_FIELDS | user header | user data | | 0x01 | | | | payload | payload | +--------+--------+----------+------------+-------------+-----------+ Length is length of subparameter data, including user header, in byte. user header payload for segmented message: +--------+----------+---------+-----------+---------+---------+-----------+ | 8 bits | 8 bits | 8 bits | 8 bits | 8 bits | 8 bits | n bits | +--------+----------+---------+-----------+---------+---------+-----------+ | header | concated | length | segment | max | current | padding | | size | sms ID | | reference | segment | segment | | +--------+----------+---------+-----------+---------+---------+-----------+ | 5 | 0 | 3 | | | | | +--------+----------+---------+-----------+---------+---------+-----------+ header size is length of header data, in byte. Padding is required to make whole user header payload aligned with encoding digit length, i.e., 7/8/16-bit aligned for 7/8/16-bit encoding. So in current case, length of user header payload is 6 bytes. No padding is required for 8/16-bit encoding, but 1 bit padding is required to make user header payload 7-bit aligned(total 49 bits = 7 septets). Also, NUM_FIELDS is size of (user header payload + user data payload), in encoding digit length instead of byte. So in 8-bit encoding, NUM_FIELDS = 6 + length of user data payload, 16-bit encoding, NUM_FIELDS = 3 + length of user data payload, 7-bit encoding, NUM_FIELDS = 7 + length of user data payload.
Assignee | ||
Comment 3•11 years ago
|
||
Add constants for sending/receiving CDMA SMS
Attachment #709593 -
Flags: review?(vyang)
Assignee | ||
Comment 4•11 years ago
|
||
Handling CDMA SMS PDU requires bitwise read/write capability, but Buf handles data in byte. So bitBuffer is introduced to provide bitwise read/write functionality on a byte array for PDU helpers.
Attachment #709594 -
Flags: review?(vyang)
Assignee | ||
Comment 5•11 years ago
|
||
Add PDU helper for CDMA, currently only core functions for SMS is provided. The interface/object of CDMA SMS functions are compatible with currently GSM SMS functions.
Attachment #709595 -
Flags: review?(vyang)
Assignee | ||
Comment 6•11 years ago
|
||
Handle incoming CDMA SMS. a new argument |smsType| is added to |_processReceivedSms()| to identify incoming SMS type.
Attachment #709596 -
Flags: review?(vyang)
Assignee | ||
Comment 7•11 years ago
|
||
Add SMS delivery function in SMS, and send SMS based on current network type.
Attachment #709597 -
Flags: review?(vyang)
Comment 8•11 years ago
|
||
Comment on attachment 709593 [details] [diff] [review] 0001. Add constants for CDMA SMS. Review of attachment 709593 [details] [diff] [review]: ----------------------------------------------------------------- Please also point out the origin of these numbers in comments. ::: dom/system/gonk/ril_consts.js @@ +2426,5 @@ > +this.PDU_CDMA_MSG_TYPE_ACK = 0x02; // Acknowledge > + > +// SMS Teleservice Identity > +this.PDU_CDMA_MSG_TELESERIVCIE_ID_SMS = 0x1002; // SMS > +this.PDU_CDMA_MSG_TELESERIVCIE_ID_WEMT = 0x1005; // Wireless Enhanced Messaging Teleservice, required for fragmented SMS line wrap please
Attachment #709593 -
Flags: review?(vyang) → review+
Comment 9•11 years ago
|
||
Comment on attachment 709594 [details] [diff] [review] 0002. Add buffer with bitwise read/write capability. Review of attachment 709594 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/system/gonk/ril_worker.js @@ +7289,5 @@ > + return null; > + } > + > + if (length > this.readCacheSize) { > + var bytesToRead = Math.ceil((length - this.readCacheSize) / 8); Please use 'let' instead. In this function 'var' works, but is still risky when new changes come in. @@ +7333,5 @@ > + } > + > + // Aligned part, just copy > + this.writeCache = 0; > + this.writeCacheSize = 0; Please move the three lines into |if (this.writeCacheSize) {...}|
Attachment #709594 -
Flags: review?(vyang)
Comment 10•11 years ago
|
||
Comment on attachment 709595 [details] [diff] [review] 0003. Add CDMA PDU helper. Review of attachment 709595 [details] [diff] [review]: ----------------------------------------------------------------- 8 line context please. ::: dom/system/gonk/ril_worker.js @@ +7504,5 @@ > + * > + * @param address > + * String of address to be encoded > + */ > + addrEncoder: function addrEncoder(address) { "encoder" is a noun, but function name should be a verb.
Comment 11•11 years ago
|
||
Comment on attachment 709596 [details] [diff] [review] 0004. Receive CDMA SMS. Review of attachment 709596 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/system/gonk/ril_worker.js @@ +1816,3 @@ > this.acknowledgeSMS(options.result == PDU_FCS_OK, options.result); > }, > 8 line context please. @@ +3606,4 @@ > * > * @return Message parsed or null for invalid message. > */ > + _processReceivedSms: function _processReceivedSms(length, smsType) { Thank you for trying hard to merge the processing flow of the two types of SMS message. But they're so different that the code reused here is nearly nothing but |if (!lenght) {...}|. I'm wondering whether can we separate the processing flow and have something like: let GsmPDUHelper = { readMessage: function () { // Move messageStringLength reading here. }, processReceivedSms: function (length) { // Move message class handling here and return // [message, PDU_FCS_OK] or [null, PDU_FCS_FOO] // when no more processing is required. } }; let CdmaPDUHelper = { processReceivedSms: function (length) { // Same here. } }; let RIL = { processSmsMultipart: function (message) { // It's originally named _processSmsDeliver but has // now only multipart handling left inside. } }; RIL[UNSOLICITED_RESPONSE_NEW_SMS] = function (length) { let [message, result] = GsmPDUHelper.processReceivedSms(length); if (message) { result = this.processSmsMultipart(message); } ... }; RIL[UNSOLICITED_RESPONSE_CDMA_NEW_SMS] = function (length) { let [message, result] = GsmPDUHelper.processReceivedSms(length); if (message) { result = this.processSmsMultipart(message); } ... };
Attachment #709596 -
Flags: review?(vyang)
Comment 12•11 years ago
|
||
Comment on attachment 709597 [details] [diff] [review] 0005. Send CDMA SMS. Review of attachment 709597 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/system/gonk/ril_worker.js @@ +5001,4 @@ > RIL[REQUEST_CDMA_FLASH] = null; > RIL[REQUEST_CDMA_BURST_DTMF] = null; > RIL[REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY] = null; > +RIL[REQUEST_CDMA_SEND_SMS] = function REQUEST_CDMA_SEND_SMS(length, options) { Please reuse this function since it's exactly the same with RIL[REQUEST_SEND_SMS].
Attachment #709597 -
Flags: review?(vyang)
Assignee | ||
Comment 13•11 years ago
|
||
Address comment 8
Attachment #709593 -
Attachment is obsolete: true
Assignee | ||
Comment 14•11 years ago
|
||
Attachment #717691 -
Flags: review?(vyang)
Assignee | ||
Comment 15•11 years ago
|
||
Address comment 9
Attachment #709594 -
Attachment is obsolete: true
Attachment #717691 -
Attachment is obsolete: true
Attachment #717691 -
Flags: review?(vyang)
Attachment #717692 -
Flags: review?(vyang)
Assignee | ||
Comment 16•11 years ago
|
||
Address comment 10.
Attachment #709595 -
Attachment is obsolete: true
Attachment #709595 -
Flags: review?(vyang)
Attachment #717693 -
Flags: review?(vyang)
Assignee | ||
Comment 17•11 years ago
|
||
Address refactory suggestion in comment 11.
Attachment #717694 -
Flags: review?(vyang)
Assignee | ||
Comment 18•11 years ago
|
||
Address refactory suggestion in comment 11.
Attachment #709596 -
Attachment is obsolete: true
Attachment #717695 -
Flags: review?(vyang)
Assignee | ||
Comment 19•11 years ago
|
||
Address refactory suggestion in comment 11. Fix wrong index of last attachment.
Attachment #717695 -
Attachment is obsolete: true
Attachment #717695 -
Flags: review?(vyang)
Attachment #717696 -
Flags: review?(vyang)
Assignee | ||
Comment 20•11 years ago
|
||
Address refactory suggestion in comment 12.
Attachment #709597 -
Attachment is obsolete: true
Attachment #717697 -
Flags: review?(vyang)
Comment 21•11 years ago
|
||
Comment on attachment 717690 [details] [diff] [review] 0001. Add constants for CDMA SMS, v1.1 Review of attachment 717690 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/system/gonk/ril_consts.js @@ +2421,5 @@ > this.MMI_SC_BA_MT = "353"; > > +// CDMA constants > +// SMS Message Type > +this.PDU_CDMA_MSG_TYPE_P2P = 0x00; // Point-to-Point Please also point out the origin of these numbers in comments.
Updated•11 years ago
|
Attachment #717690 -
Flags: review+
Comment 22•11 years ago
|
||
Comment on attachment 717692 [details] [diff] [review] 0002. Add buffer with bitwise read/write capability, v1.1 Review of attachment 717692 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/system/gonk/ril_worker.js @@ +7209,5 @@ > > +/** > + * Provide buffer with bitwise read/write function so make encoding/decoding easier. > + */ > +let bitBuffer = { BitBufferHelper?
Attachment #717692 -
Flags: review?(vyang) → review+
Updated•11 years ago
|
Attachment #717693 -
Flags: review?(vyang) → review+
Comment 23•11 years ago
|
||
Comment on attachment 717694 [details] [diff] [review] 0004. Refactory GSM SMS flow. Review of attachment 717694 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/system/gonk/ril_worker.js @@ +6595,5 @@ > + if (message.epid == PDU_PID_SHORT_MESSAGE_TYPE_0) { > + // `A short message type 0 indicates that the ME must acknowledge receipt > + // of the short message but shall discard its contents.` ~ 3GPP TS 23.040 > + // 9.2.3.9 > + return [message, PDU_FCS_OK]; Shall return [null, PDU_FCS_OK] instead to prevent TYPE_0 messages being further processed.
Attachment #717694 -
Flags: review?(vyang)
Comment 24•11 years ago
|
||
Comment on attachment 717696 [details] [diff] [review] 0005. Receive CDMA SMS, v1.1 Review of attachment 717696 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/system/gonk/ril_worker.js @@ +1729,5 @@ > } > + if (this._isCdma) { > + this.acknowledgeCdmaSms(options.result == PDU_FCS_OK, options.result); > + } else { > + this.acknowledgeSMS(options.result == PDU_FCS_OK, options.result); Then please also rename it to 'acknowledgeGsmSms'.
Attachment #717696 -
Flags: review?(vyang) → review+
Comment 25•11 years ago
|
||
Comment on attachment 717697 [details] [diff] [review] 0006. Send CDMA SMS, v1.1 Review of attachment 717697 [details] [diff] [review]: ----------------------------------------------------------------- Great job!
Attachment #717697 -
Flags: review?(vyang) → review+
Assignee | ||
Comment 26•11 years ago
|
||
Address comment 21
Attachment #717690 -
Attachment is obsolete: true
Assignee | ||
Comment 27•11 years ago
|
||
Address comment 22
Attachment #717692 -
Attachment is obsolete: true
Assignee | ||
Comment 28•11 years ago
|
||
Address comment 22
Attachment #717693 -
Attachment is obsolete: true
Assignee | ||
Comment 29•11 years ago
|
||
Fix return value per comment 23
Attachment #717694 -
Attachment is obsolete: true
Attachment #717795 -
Flags: review?(vyang)
Assignee | ||
Comment 30•11 years ago
|
||
Address comment 25
Attachment #717696 -
Attachment is obsolete: true
Assignee | ||
Comment 31•11 years ago
|
||
(In reply to Chuck Lee [:chucklee] from comment #30) > Created attachment 717797 [details] [diff] [review] > 0005. Receive CDMA SMS, v1.2 > > Address comment 25 s/comment 25/comment 24
Assignee | ||
Comment 32•11 years ago
|
||
try for current patch set : https://tbpl.mozilla.org/?tree=Try&rev=b7b32915cf1f
Updated•11 years ago
|
Attachment #717795 -
Flags: review?(vyang) → review+
Comment 33•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/6bb31f0b063f https://hg.mozilla.org/integration/mozilla-inbound/rev/e0dbbe8a3afc https://hg.mozilla.org/integration/mozilla-inbound/rev/310f40bb3b6a https://hg.mozilla.org/integration/mozilla-inbound/rev/a4f3ab746de8 https://hg.mozilla.org/integration/mozilla-inbound/rev/c94decbf663f https://hg.mozilla.org/integration/mozilla-inbound/rev/fa7820b84e2f
Comment 34•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/6bb31f0b063f https://hg.mozilla.org/mozilla-central/rev/e0dbbe8a3afc https://hg.mozilla.org/mozilla-central/rev/310f40bb3b6a https://hg.mozilla.org/mozilla-central/rev/a4f3ab746de8 https://hg.mozilla.org/mozilla-central/rev/c94decbf663f https://hg.mozilla.org/mozilla-central/rev/fa7820b84e2f
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in
before you can comment on or make changes to this bug.
Description
•