**** BEGIN LOGGING AT Mon Dec 14 23:57:06 2009 Dec 15 00:13:25 denkenz: ping Dec 15 00:15:27 pong Dec 15 00:21:16 holtmann, zhenhua1: I suggest g_at_server or g_at_interface instead of g_at_emu Dec 15 00:22:21 denkenz: i will vote the g_at_server. anyway, it's just a name. both are fine for me. Dec 15 00:22:34 My vote goes for g_at_server, too. Dec 15 00:22:43 ok, g_at_server it is then Dec 15 00:22:55 g_at_modem would be another option. Dec 15 00:23:38 modem already has too many connotations in plugins & core Dec 15 00:23:57 how about g_at_adapter Dec 15 00:24:22 adapter is usually adapting something... Dec 15 00:24:31 Then we go with server. Dec 15 00:24:47 it acts as terminal adapter Dec 15 00:25:55 Then, we need g_at_server_new_tty, _new_tcp and _new_unix Dec 15 00:26:15 unix is optional Dec 15 00:26:15 what _new_unix dos for? Dec 15 00:26:29 same as tcp, but different socket Dec 15 00:26:39 UNIX is slightly faster through the kernel than TCP Dec 15 00:27:10 can I find any reference code for unix socket Dec 15 00:27:23 man 7 unix Dec 15 00:27:28 ok Dec 15 00:27:41 got it Dec 15 00:28:13 _shutdown, _set_debug and set_disconnect_function are fine as is Dec 15 00:30:33 sorry for network problem. i was dropped Dec 15 00:30:34 no worries, get rid of g_at_emu_send, I don't understand what it does Dec 15 00:30:34 ok Dec 15 00:30:34 Also get rid of the internal GAtChat, that is wrong Dec 15 00:30:40 The syntax for command submission is different Dec 15 00:31:00 i know. but syntax is an input for GAtChat. Dec 15 00:31:09 we just need to create server side syntax for chat. Dec 15 00:31:20 server side syntax is always the same Dec 15 00:31:36 So you don't need to customize it Dec 15 00:31:43 +xxx: xxx Dec 15 00:31:46 ok Dec 15 00:31:55 That's response syntax Dec 15 00:32:10 And we follow 27.007 here according to how V0/V1 is set Dec 15 00:32:37 Yes. If it doesn't work with the strict parser, we fucked it up ;) Dec 15 00:33:01 i don't have spec now. I will look at V0/V1 later. Dec 15 00:33:14 So command submission is always ATCOMMAND\r Dec 15 00:33:26 yes. Dec 15 00:33:28 It is easy to parse and always follows that rule Dec 15 00:33:53 so i believe many api will be same as gatchat. Dec 15 00:33:59 The server needs to echo / not echo according to E0/E1 and send responses according to V0/V1 Dec 15 00:34:21 Default those options to echo true and v1 Dec 15 00:34:22 do we also need the scheduler, writer like gatchat does? Dec 15 00:34:44 The scheduler is simpler, but yes Dec 15 00:35:06 that's my point. we can reuse that scheduler Dec 15 00:35:23 of gatchat? Too big a hammer Dec 15 00:35:34 ... Dec 15 00:35:48 trust me, you don't need it Dec 15 00:35:59 It will be 50 lines of code to do a new one Dec 15 00:36:13 yes. i will try Dec 15 00:37:18 that's enough for me to spend a week maybe. Dec 15 00:37:35 Also, lets do g_at_server_add_command do something like: Dec 15 00:38:21 guint g_at_server_add_command(server, command, expect_pdu, notify, user_data, destroy) Dec 15 00:38:30 notify should have a signature of Dec 15 00:39:16 notify(enum GAtServerRequestType type, GAtResult, user_data) Dec 15 00:39:41 where request type is Set, Support, Query Dec 15 00:40:08 no probs Dec 15 00:40:56 get rid of add_notify for now, it doesn't belong in g_at_server Dec 15 00:41:10 And add g_at_server_send_unsolicited() Dec 15 00:41:20 good. Dec 15 00:41:49 And also do one for g_at_server_send_response() Dec 15 00:42:03 We might have to do a multiline response for things like COPN, but lets do that one later Dec 15 00:42:43 ok. let's support single response first. Dec 15 00:43:10 Ok, work on those changes. I want those in first Dec 15 00:43:19 And handle all the V250 commands Dec 15 00:43:26 You can safely ignore most except V & E Dec 15 00:43:44 i need first read V250 and then discuss issues with u Dec 15 00:44:05 yep, also read 27.007 as it discusses how to implement some of the V250 commands Dec 15 00:44:13 okay Dec 15 00:44:31 i still have opens about how to get response from real modem Dec 15 00:44:47 two ways, through dbus call or API call Dec 15 00:45:03 Inside oFono? I have to figure that out Dec 15 00:45:04 for manager_dial, i have to use dbus call now Dec 15 00:45:11 Most likely we make up APIs specifically for AT emulator Dec 15 00:45:14 yes. inside ofono. Dec 15 00:45:32 it needs changes in core part. Dec 15 00:45:42 It does Dec 15 00:45:49 I always knew it would :) Dec 15 00:46:13 For now you can do your testing by proxying to a modem Dec 15 00:46:19 yeah. maybe you need split 1 func to 3... Dec 15 00:46:29 Even phonesim can work here Dec 15 00:46:39 have details? Dec 15 00:46:45 how to proxy to a modem? Dec 15 00:47:01 oh Dec 15 00:47:14 that's what i am doing now. Dec 15 00:48:11 what's the parameter for g_at_server_send_response()? Dec 15 00:49:19 Simple, open up a g_at_server and inside connect a gatchat to phonesim Dec 15 00:49:23 then just send commands as is to phonesim and send back what it sends Dec 15 00:49:24 Simple AT emulator, but you can check that all your formatting, etc is correct Dec 15 00:49:30 the response string and the error Dec 15 00:49:35 The error should be like CMS/CME/OK/ERROR Dec 15 00:49:35 Let the function figure out what to send according to V setting Dec 15 00:52:34 ok. i will try it so see what happens. **** BEGIN LOGGING AT Tue Dec 15 01:17:44 2009 **** BEGIN LOGGING AT Tue Dec 15 02:11:45 2009 Dec 15 02:31:30 zhenhua1: That reminds me, you might also want to look into how to support compound commands Dec 15 02:31:55 e.g. ATCMD1 CMD2=foo +CMD3=blah; +CMD4=bar\r Dec 15 02:31:57 example? Dec 15 02:32:11 yes Dec 15 02:32:28 so it's the parser work in g_at_server Dec 15 02:32:36 yep Dec 15 02:32:48 i need figure out how to do that. Dec 15 02:33:01 so i need another server side syntax Dec 15 02:33:19 Again, this is set in stone Dec 15 02:33:29 So you can just hardcode the behavior, as long as it is per spec Dec 15 02:34:19 yes. Dec 15 02:40:40 denkenz: ATCMD1 CMD2=foo\r. It looks I need to put them into a queue, and execute them in order. Dec 15 02:41:10 denkenz: if the first command result is wrong, we return ERROR\r\n back. right? Dec 15 02:41:42 If the first one fails we return whatever error it fails with Dec 15 02:42:06 if the second one fails, we return whatever error it fails with, but we also print any intermediate response of the first command Dec 15 02:42:08 yes Dec 15 02:43:01 return first+second at one time? or return first response, then return second fail? Dec 15 02:45:45 there's only one final response Dec 15 02:46:14 If first command doesn't have an intermediate response, then we simply return error Dec 15 02:46:57 i see **** ENDING LOGGING AT Tue Dec 15 02:59:57 2009