**** BEGIN LOGGING AT Wed Mar 17 02:59:57 2010 Mar 17 03:07:59 denkenz: ping Mar 17 03:14:23 pong Mar 17 03:34:48 denkenz: I have bunch of questions here;) Mar 17 03:35:07 1. Does at command contain '\0\? Mar 17 03:35:16 '\0' Mar 17 03:41:28 shouldn't Mar 17 03:44:14 OK, so we don't need len for it. Mar 17 03:44:23 2. Could DF have more than 2 levels? Can I still use GSList to store a file list? We can also have a pointer array (maximum size is 256) to store it, but I think in this way, we may consume much more memory. Mar 17 03:50:11 So as I pointed in my reply, we should ignore the possibility of more than 2 DFs Mar 17 03:50:21 If that turns out to be wrong, we fix it later Mar 17 03:50:37 GSList is fine though Mar 17 03:52:00 OK Mar 17 03:52:08 3. Why is utf8 defined as char *, rather than unsigned char *? Mar 17 03:53:47 more convenience, ascii is subset of utf8 Mar 17 03:54:02 and most printf* functions handle utf8 Mar 17 03:54:54 got it. Mar 17 03:54:55 4. In current implementaion of parse_send_sms(), it seems the case for CDMA is not handled. Do we ignore it for the time being? Mar 17 03:55:16 for now yes, we can't handle CDMA ones anyway Mar 17 03:55:37 maybe check that gsm pdu was actually given and fail parsing otherwise Mar 17 03:56:24 If so, I also think we should change it to be DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM Mar 17 03:56:53 That's fine for now Mar 17 03:57:09 Though it is better to handle it as a special case Mar 17 03:57:30 Since its not really mandatory Mar 17 03:57:50 Would oFono support CDMA someday? Mar 17 03:57:55 yes Mar 17 03:58:05 Then we can handle it then. Mar 17 03:58:14 5. Need we know the difference: some comprehension tlv is absent, or the ctlv is there and have default value. Mar 17 03:58:56 generally this is not a problem, if a ctlv is absent it can be marked null Mar 17 03:59:11 Only a few special cases like display text having null values Mar 17 04:01:47 Fine. Mar 17 04:02:08 Last question is about the logic in parse_dataobj() Mar 17 04:02:50 If some ctlv doesn't have valid content, the whole ber-tlv would not be decoded. Mar 17 04:03:06 Is that an expected behavior? Mar 17 04:04:05 That's not really how it works Mar 17 04:04:43 I mean the ret is FALSE. and comprehension_tlv_iter_next(iter) will never be executed. Mar 17 04:04:48 Am I wrong? Mar 17 04:06:14 Basically you're correct, but we do retry other ctlv types Mar 17 04:06:57 So if the data inside the ctlv is corrupt, then yes we fail to parse it Mar 17 04:07:00 But iter never goes forward, so the rest handing would all fail. Mar 17 04:07:44 I'm OK for it right now, if it's an expected behavior. Mar 17 04:08:01 I just think this's too strict. Mar 17 04:08:35 I have to check what is expected if the data is invalid, I believe we should fail Mar 17 04:08:49 But I have been wrong before Mar 17 04:09:31 Perhaps we need a different return type depending on whether it is a tag mismatch or the corrupt data Mar 17 04:09:42 Then if corrupt we can advance the iter Mar 17 04:10:09 A simple alternative is to check the tag of each iter, and handle it. Mar 17 04:10:31 But this also has a drawback: It's hard to check the sequence. Mar 17 04:12:06 Anyway, if we want to have the logic to check the validity of the ber-tlv, the ctlv, the sequence, the M|O|C, minimum or not, the code could be too complicated. Mar 17 04:13:15 So now, we could be strict, and make code simple. Mar 17 04:14:34 Your idea on different return type is also a good enhancement. Mar 17 04:15:34 The minimum part is easy, but we have to enforce the sequence, the standard mandates it Mar 17 04:15:57 anyway, feel free to suggest improvements, you have to do most of the hard work anyway ;) Mar 17 04:18:15 For now, I'd like to leave it be. I will think about it after the basic things can work. Mar 17 04:18:31 Thanks for your answer. Mar 17 04:19:06 have a good night! Mar 17 04:33:24 denkenz: Do you have any problems with the PPP filenames? Mar 17 04:34:01 yes, I'd rather they not be called gatfooprotocol Mar 17 04:34:09 particularly if they're internal Mar 17 04:37:44 I'd also prefer ppp_fooprotocol and the internal header to be named ppp instead of foo_internal.h Mar 17 04:38:06 Then again, much of what we have now is not terribly consistent... Mar 17 04:46:37 I think we are not really getting around the gatppp.c thing. Mar 17 04:46:52 The _internal is something I dislike too. Mar 17 04:47:01 imo its fine to call them ppp_proto.c Mar 17 04:47:10 Then leave gatppp.c as is Mar 17 04:47:26 Yeah. I think ppp_auth.c etc. makes sense. Mar 17 04:47:35 We do the same for gsm0710.c Mar 17 04:47:47 And ringbuffer.c Mar 17 04:47:52 exactly, and we can name the internal header ppp.h Mar 17 04:48:03 Only the ones that are exported have gat* prefix. Mar 17 04:48:29 Just make sure the internal ones are not installed, and we might have to fixup ringbuffer.h since it has include guards Mar 17 04:48:46 Hah. I overlooked that one. Mar 17 04:48:59 My mistake. Mar 17 04:49:07 Was probably mine actually Mar 17 04:49:18 So does gsm0710.h as well :( Mar 17 04:49:19 Same with gsm0710.h Mar 17 04:49:40 I am bad here. So I have to do some cleanup. Mar 17 04:49:45 Again, I think we need to start thinking of making gatchat into a proper lib with subdirectories Mar 17 04:49:55 e.g. src, tools Mar 17 04:50:00 include Mar 17 04:50:04 Until we are done with PPP and AT server, I don't wanna go there. Mar 17 04:50:22 But yes, I general I agree. Other projects would benefit from it a lot. Mar 17 04:50:37 Well, for now we don't have to break it out Mar 17 04:50:46 But internally we can start moving stuff around Mar 17 04:50:57 Especially since no other project includes it now Mar 17 04:51:04 I like to not do it. Mar 17 04:51:08 At least not now. Mar 17 04:51:29 Good that ConnMan is gatchat free these days :) Mar 17 04:51:39 That's fine, not urgent, but it will need major cleanup eventually Mar 17 04:52:04 We are just running too fast lately, it is starting to catch up with us Mar 17 04:53:39 And I'm fine if you push Kristen's changes and just git mv Mar 17 04:54:17 No. I will ask here to rename. And then I merge it. Mar 17 04:54:31 Then we better do one more round of reviews Mar 17 04:54:32 These are quick changes on here side. Mar 17 04:54:42 I go through it in an hour. Mar 17 04:54:54 Ok, I won't do it until tomorrow morning Mar 17 04:55:28 Don't worry. I do the first review. You take care of your other 100+ patches. Mar 17 04:58:53 I do want to implement the ppp gprs context by end of this month too Mar 17 04:59:15 So I should at least review gatppp anyway Mar 17 14:06:34 denkenz: around? Mar 17 15:05:10 ygu5_home: yep Mar 17 15:05:44 denkenz: Sorry to disturb you again in the morning. Mar 17 15:06:06 Can we discuss the patch of parse_dataobj_file_list()? Mar 17 15:06:54 I think I don't need to know the identify of file except 0x3f. Mar 17 15:07:20 Take an example: 3F00 7F10 6F3A 3F00 2FE2 Mar 17 15:07:28 Here are two files. Mar 17 15:07:37 Is that correct? Mar 17 15:08:06 Both begin with 0x3F Mar 17 15:08:25 yep, but 0x3F can occur in 2nd byte Mar 17 15:09:34 But yes, in theory you can get away with just 0x3F, still, to be more pedantic it might be worthwhile to do a mini-parser that verifies the file structure Mar 17 15:09:41 But the spec says "each entry in the file description is composed of two bytes, where the first byte identifies the type of file" Mar 17 15:10:04 Well, e.g. this can happen: 3F00 7F10 6F3F Mar 17 15:10:33 I don't think the second 0x3F is the beginning of a file. Mar 17 15:10:38 it isn't Mar 17 15:10:51 So my code add i by 2 every time. Mar 17 15:10:58 Here is the code: Mar 17 15:11:03 for (i = start + 4; i <= len; i += 2) { Mar 17 15:11:04 if ((data[i] == 0x3f) || (i == len)) { Mar 17 15:11:04 sf = g_new0(struct stk_file, 1); Mar 17 15:11:04 sf->file = g_malloc(i-start); Mar 17 15:11:04 memcpy(sf->file, data+start, i-start); Mar 17 15:11:04 sf->len = i - start; Mar 17 15:11:04 *fl = g_slist_prepend(*fl, sf); Mar 17 15:11:05 start = i; Mar 17 15:11:05 } Mar 17 15:11:06 } Mar 17 15:11:24 Just to skip this situation Mar 17 15:11:44 start + 4 makes no sense, that is not where the filenames start Mar 17 15:12:33 I check data[start] has to be 0x3F Mar 17 15:12:51 And every file should be at least 4 bytes. Mar 17 15:12:56 except the filenames start at data + 1 Mar 17 15:12:59 So I begin with start + 4 Mar 17 15:13:32 > + if (data[start] != 0x3f) > + return FALSE; Mar 17 15:13:56 I check the first byte has to be 0x3F Mar 17 15:14:11 The for loop is to find the end of each file path Mar 17 15:14:21 So I begin from start + 4 Mar 17 15:14:49 again, I suggest you use the TS 11.11 semantics to do the checking, and create the file once elementary file id is reached Mar 17 15:15:07 Relying on 0x3F is not good enough Mar 17 15:15:39 Your goal here is not to submit something that barely works, but submit something that is bullet proof Mar 17 15:16:11 So I don't care if it takes you two weeks instead of one, if the quality is there Mar 17 15:16:13 OK. I will do that. Mar 17 15:17:37 You have listed 6 types for MF|DF|EF. May I check the validity based on these? Mar 17 15:17:52 yeah, check based on those Mar 17 15:17:58 OK. Mar 17 15:18:13 I will do that tomorrow, and send you the patch for review. Mar 17 15:18:54 Another problem for me is to parse ber-tlv open channel. Mar 17 15:19:23 It has many different sub-formats Mar 17 15:19:44 I don't have a good idea to parse it. Mar 17 15:19:57 I can have several structs to define each of them. Mar 17 15:20:11 And use an union to include these structs. Mar 17 15:20:51 that would be my approach Mar 17 15:21:11 But how to parse them? Mar 17 15:21:20 Use several if else? Mar 17 15:22:41 How does it distinguish between the different types? qualifier inside command details or ? Mar 17 15:22:57 That's my question too;) Mar 17 15:23:16 I looked at command details, but didn't find the clue. Mar 17 15:24:06 Dig some more and check the test spec Mar 17 15:24:20 Sometimes looking at sample data makes things clearer Mar 17 15:24:24 OK. I will search the spec again. Mar 17 15:24:46 Good suggestion, and I will. Mar 17 15:26:22 Have a good day:) Mar 17 15:37:10 I need to run away and hide from all the patches now Mar 18 00:37:03 denkenz: ping Mar 18 00:54:47 zhenhua: pong Mar 18 00:56:09 denkenz: i am not convinced about caching result in send_final. Mar 18 00:56:27 the current way looks good and clean enough to me. Mar 18 00:56:39 and doesn't handle extended results Mar 18 00:57:18 sorry? what do you mean? Mar 18 00:57:45 The code doesn't handle extended errors right now Mar 18 00:58:47 And I don't see the point of the callback doing something like: Mar 18 00:58:48 the extended error is sent from g_at_server_send_ext_final by upper layer. the callback should return EXT_ERROR then we're done. Mar 18 00:59:03 send_ext_error; return EXT_ERROR Mar 18 01:00:39 i think no need to have it. the callback should return EXT_ERROR. no need to expose send_ext_final api to upper layer. Mar 18 01:01:17 And how do you propose to send +CME ERROR? Mar 18 01:02:05 you're right. i should add this api. Mar 18 01:02:25 i forgot it. Mar 18 01:03:06 anyway, my concern is: to cache the result makes send_final more complex Mar 18 01:03:21 You're only caching the last one Mar 18 01:03:41 And in fact you don't need to even format the response unless its an extended response Mar 18 01:04:31 I bet ya it isn't even that complex ;) Mar 18 01:04:52 how do you know when it is the last OK response? Mar 18 01:05:22 When you finished parsing the command line Mar 18 01:06:04 i know, but you invoke the same send_final. the last and current result is all OK Mar 18 01:06:37 you wanna add something send_flush? Mar 18 01:06:39 what the application invokes will be different from what actually sends the OK Mar 18 01:06:59 to give you an idea, check out src/tools/atinterface/ in qt extended Mar 18 01:07:15 Does exactly the way I propose Mar 18 01:07:38 okay, actually i have seen atinterface several times.;-) Mar 18 01:08:00 anyway, i can do that. Mar 18 01:08:38 Again, it is just cleaner for the application, they always call the result function and we figure out when to actually send it Mar 18 01:08:47 why not keep the while loop in the main logic? I know buf always true actually Mar 18 01:09:06 while loop sure, but it should not be while buf Mar 18 01:09:15 while (1)? Mar 18 01:09:30 how about while (cur < len) or something ;) Mar 18 01:09:56 what's the different, boss? Mar 18 01:10:13 People don't go 'wtf?' when they read the code Mar 18 01:10:15 i really think all are good Mar 18 01:11:33 i don't have cur variable now. ;-) Mar 18 01:12:21 could you have suggestions? ;-) Mar 18 01:14:21 jeez, do I have to do your job too now? ;) Mar 18 01:15:01 ok. so let me think to replace with sth more meaningful Mar 18 01:15:10 do at least something like while (*buf) Mar 18 01:15:22 but you can make that loop a heck of alot simpler Mar 18 01:16:51 maybe i should wrapper the loop body into a function, right? Mar 18 01:23:39 denkenz: any other comments for my patches? Mar 18 01:36:29 zhenhua: Only other thing is to use switch/case in your at command implementation Mar 18 01:36:32 will look neater Mar 18 01:37:38 i also think about that, but only three cases. and we will have more small chunks of functions. Mar 18 01:38:07 i will try that way and send a patch for review **** ENDING LOGGING AT Thu Mar 18 02:59:56 2010