RE: [RESEND 3 PATCH 00/13] IPv6 Support
Hi Denis, Disabling IPv6 stateless address would be a bold move indeed, since it is declared mandatory in both IETF and 3GPP standards. Please see [RFC4294] and [3GPP 23.060]. The section Dynamic IPv6 Address Allocation in 23.060 is very clear on how IPv6 address allocation in 3GPPP networks is done. See also the section about IPv6 prefix delegation (relevant to IPv6 tethering) and applicable parts of 24.008. This still needs to be figured out. We are aware that autoconfiguration is mandatory in 3GPP. However, this seems to be going against 27.007. There is no contradiction. Let me explain what I mean. The 3GPP standards mostly talk about MS (mobile station) which comprises of both TE and MT (terminal equipment and modem terminal). As such, 3GPP specifications place requirements on both TE and MT. The 27.007 defines a TA (terminal adapter), which is one possible interface between TE and MT. However, 27.007 is not mandatory, vendor specific interfaces are also allowed. As a consequence other interfaces, such as ISI and CAIF, also exist. While stateless address autoconfiguration is mandatory for MS, a funky AT modem could potentially have an internal IPv6 stack as part of the TA function and perform address configuration against the network and then proxy any IPv6 traffic between the TE and the network. This would meet the requirements of 3GPP. The *intent* in the 3GPP standards is that TEs can behave as standard IPv6 hosts (so PCs can use a standard IPv6 stack), which means that the TE is expected to run the autoconfiguration protocols against the network in the normal case. Nothing in 27.007 specifically prevents that. The static address configuration parameters in the AT commands are optional and will simply be missing, if the modem just acts as a bitpipe between TE and the network, allowing the TE to run its IPv6 stack in the normal way. However, a funky AT modem that implements an IPv6 stack internally and exposes static address configuration parameters towards TE is certainly possible. Such a modem would presumably also block the router advertisements coming from the network, which would effectively disable stateless address autoconfiguration for the TE. This is not something you need or should do in connman. Standard IPv6 stack is sufficient. So in the end both might be required. On this I agree. Stateless address autoconfiguration is needed because it is mandatory in both IETF and 3GPP standards (sorry for the repetition). Static configuration (optional in IETF standards) may also be needed but that remains to be seen. It depends on what kind of funky AT modems are and will be out there. In the end oFono's philosophy is to always err on the side of 27.007. So far this strategy has never been (completely) wrong. 27.007 provides a nice checklist for the functionality of the modem, so in that sense you're right. In another way it also serves as a lowest common denominator for the same functionality. However, what 27.007 does not do is specify system behaviour. It's easy to jump to conclusions just by looking at what AT commands are available. Most of the commands are optional, because a lot of freedom has intentionally been left for the implementors. It is also why, IMO, the specification is so bad and we have to fight with all these quirky AT modem implementations. Remember that 3GPP standards specify the behavour between MS and the nework. I.e., they place requirements on both TE and MT. The AT interface (TA function) stands in between and the combination of TE+TA+MT must function in accordance to 3GPP standards. My point is, you *really* need to read other 3GPP specification, like 23.060 and 24.008, in order to understand what requirements 3GPP places on oFono. Reading 27.007 will not tell you that. Regards, MikaL ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH 4/4] emulator: add +COPS support
Hello Denis, Le 17/03/2011 22:18, Denis Kenzior a écrit : Hi Frédéric, On 03/17/2011 11:50 AM, Frédéric Danis wrote: This needs to be in emulator as HFP plugin should answer AT+COPS requests even when oFono is not registered on network. --- src/emulator.c | 72 src/network.c | 90 +++ 2 files changed, 155 insertions(+), 7 deletions(-) diff --git a/src/emulator.c b/src/emulator.c index 864e50b..eb4f49e 100644 --- a/src/emulator.c +++ b/src/emulator.c @@ -49,6 +49,8 @@ struct ofono_emulator { int events_mode; gboolean events_ind; GSList *indicators; + char op_name[17]; + int net_mode; }; struct indicator { @@ -387,6 +389,59 @@ fail: } } +static void cops_cb(GAtServer *server, GAtServerRequestType type, + GAtResult *result, gpointer user_data) +{ + struct ofono_emulator *em = user_data; + char buf[32]; + + if (em-type == OFONO_EMULATOR_TYPE_HFP em-slc == FALSE) { + g_at_server_send_final(em-server, G_AT_SERVER_RESULT_ERROR); + return; + } + There's no need for this if you use ofono_emulator_add_handler since the handler_proxy will take care of this detail. + switch (type) { + case G_AT_SERVER_REQUEST_TYPE_QUERY: + sprintf(buf, +COPS: %d,0,\%s\, em-net_mode, em-op_name); + g_at_server_send_info(em-server, buf, TRUE); + g_at_server_send_final(server, G_AT_SERVER_RESULT_OK); + break; + + case G_AT_SERVER_REQUEST_TYPE_SET: + { + GAtResultIter iter; + int val; + + g_at_result_iter_init(iter, result); + g_at_result_iter_next(iter, ); + + if (!g_at_result_iter_next_number(iter,val)) + goto fail; + + if (val != 3) + goto fail; + + if (!g_at_result_iter_next_number(iter,val)) + goto fail; + + if (val != 0) + goto fail; + + /* check there is no more parameter */ + if (g_at_result_iter_skip_next(iter)) + goto fail; + + g_at_server_send_final(server, G_AT_SERVER_RESULT_OK); + break; + } + + default: +fail: + g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR); + break; + } +} + Please move this function to netreg.c. This should make this patch quite a bit simpler. snip Regards, -Denis If this is moved to netreg.c, AT+COPS requests will not be handled when oFono modem is not online. I understand that there is no problem to reply ERROR to AT+COPS?, but I think this is wrong for AT+COPS=3,0. This is why I do this in emulator.c. -- Frederic DanisOpen Source Technology Centre frederic.da...@intel.com Intel Corporation ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH 01/12] dbus: add gnss interface definition
Hi Denis, On Fri, 2011-03-18 at 06:26 +0200, Denis Kenzior wrote: Hi Jarko, On 03/11/2011 06:22 AM, Jarko Poutiainen wrote: --- include/dbus.h |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/include/dbus.h b/include/dbus.h index 19a138a..bf3e8a4 100644 --- a/include/dbus.h +++ b/include/dbus.h @@ -56,6 +56,8 @@ extern C { #define OFONO_STK_INTERFACE OFONO_SERVICE .SimToolkit #define OFONO_SIM_APP_INTERFACE OFONO_SERVICE .SimToolkitAgent #define OFONO_LOCATION_REPORTING_INTERFACE OFONO_SERVICE .LocationReporting +#define OFONO_AS_NAVIGATION_INTERFACE org.ofono.AssistedSatelliteNavigation Please name this OFONO_GNSS_INTERFACE Ok +#define OFONO_POSITIONING_REQUEST_INTERFACE org.ofono.PositioningRequestAgent Please name this OFONO_GNSS_POSR_INTERFACE or OFONO_GNSS_POSR_AGENT_INTERFACE Or feel free to suggest a better name, but the current names are getting too big Ok I'll use OFONO_GNSS_POSR_AGENT_INTERFACE /* CDMA Interfaces */ #define OFONO_CDMA_VOICECALL_MANAGER_INTERFACE org.ofono.cdma.VoiceCallManager Regards, -Denis Br, Jarko ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH 02/12] include: add gnss.h file
Hi Denis, On Fri, 2011-03-18 at 06:29 +0200, Denis Kenzior wrote: Hi Jarko, On 03/11/2011 06:22 AM, Jarko Poutiainen wrote: --- Makefile.am|2 +- include/gnss.h | 76 2 files changed, 77 insertions(+), 1 deletions(-) create mode 100644 include/gnss.h diff --git a/Makefile.am b/Makefile.am index 3f20717..7d6acce 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,7 +15,7 @@ pkginclude_HEADERS = include/log.h include/plugin.h include/history.h \ include/ctm.h include/cdma-voicecall.h \ include/cdma-sms.h include/sim-auth.h \ include/gprs-provision.h include/emulator.h \ - include/location-reporting.h + include/location-reporting.h include/gnss.h nodist_pkginclude_HEADERS = include/version.h diff --git a/include/gnss.h b/include/gnss.h new file mode 100644 index 000..d10ab11 --- /dev/null +++ b/include/gnss.h @@ -0,0 +1,76 @@ +/* + * + * oFono - Open Source Telephony + * + * Copyright (C) 2008-2010 Intel Corporation. All rights reserved. + * Copyright (C) 2011 ST-Ericsson AB. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifndef __OFONO_GNSS_H +#define __OFONO_GNSS_H + +#ifdef __cplusplus +extern C { +#endif + +#include ofono/types.h + +struct ofono_gnss; + +typedef void (*ofono_gnss_position_report_cb_t)(const struct ofono_error *error, + void *data); + +typedef void (*ofono_gnss_send_element_cb_t)(const struct ofono_error *error, + void *data); + +typedef void (*ofono_gnss_report_reset_cb_t)(const struct ofono_error *error, + void *data); Please just combine these into a single callback, they have the same signature. E.g. something like ofono_gnss_cb_t That's a good point, thank you. + +struct ofono_gnss_driver { + const char *name; + int (*probe)(struct ofono_gnss *gnss, unsigned int vendor, void *data); + void (*remove)(struct ofono_gnss *gnss); + void (*send_element)(struct ofono_gnss *gnss, + const char *xml, + ofono_gnss_send_element_cb_t cb, void *data); + void (*position_reporting)(struct ofono_gnss *gnss, + ofono_bool_t enable, + ofono_gnss_position_report_cb_t cb, + void *data); Please name this set_position_reporting or set_posr Ok I'll name it set_position_reporting. +}; + +void ofono_gnss_receive_request(struct ofono_gnss *gnss, const char *xml); +void ofono_gnss_receive_reset(struct ofono_gnss *gnss); Please use notify instead of receive. E.g. ofono_gnss_notify_posr_reset and ofono_gnss_notify_posr_request Ok I'll do that. +int ofono_gnss_driver_register(const struct ofono_gnss_driver *d); +void ofono_gnss_driver_unregister(const struct ofono_gnss_driver *d); + +struct ofono_gnss *ofono_gnss_create(struct ofono_modem *modem, + unsigned int vendor, + const char *driver, void *data); + +void ofono_gnss_register(struct ofono_gnss *gnss); +void ofono_gnss_remove(struct ofono_gnss *gnss); + +void ofono_gnss_set_data(struct ofono_gnss *gnss, void *data); +void *ofono_gnss_get_data(struct ofono_gnss *gnss); + + +#ifdef __cplusplus +} +#endif + +#endif /* __OFONO_GNSS_H */ Regards, -Denis Br, Jarko ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH 01/12] doc: fix typo and incorrect line length
--- doc/dialup-command-set.txt | 70 ++- 1 files changed, 36 insertions(+), 34 deletions(-) diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt index a7a1df3..3e40aae 100644 --- a/doc/dialup-command-set.txt +++ b/doc/dialup-command-set.txt @@ -1,45 +1,47 @@ -This document specifies the AT command set used in the bluetooth ofono plugins. +This document specifies the AT command supported in the AT Emulator and atoms. Bluetooth Dial-up Networking Profile Features Description = -(Ref. document: Dial-up Networking Profile - Bluetooth specification version 1.1 - 22 February 2001) +(Ref. document: Dial-up Networking Profile - Bluetooth specification +version 1.1- 22 February 2001) -- AT COMMAND SET USED: +- AT COMMAND set used: Commands: - C Circuit 109 (DCD) Control - D Circuit 108 (DTR) Response - F Set to Factory Defined Configuration - +GCAP Request Complete Capabilities List - +GMIRequest Manufacturer Identification - +GMMRead Model Identification - +GMRRead Revision Identification - A Answer Incoming Call - D Dial - E Command Echo - H Hang Up - L Monitor Speaker Loudness - M Monitor Speaker Control - O Return to Online Data Mode - P Select Pulse Dialling - Q Result Code Suppression - S0 Automatic Answer Control - S10 Automatic Disconnect Delay Control - S3 Command Line Termination Character - S4 Response Formatting Character - S5 Command Line Editing Character (BACKSPACE) - S6 Blind Dial Delay Control - S7 Connection Completion Timeout - S8 Comma Dial Modifier Delay Control - T Select Tone Dialling - V DCE Response Format - X Call Progress Monitoring Control - Z Reset to Default Configuration + C Circuit 109 (DCD) Control + D Circuit 108 (DTR) Response + F Set to Factory Defined Configuration + +GCAP Request Complete Capabilities List + +GMIRequest Manufacturer Identification + +GMMRead Model Identification + +GMRRead Revision Identification + A Answer Incoming Call + D Dial + E Command Echo + H Hang Up + L Monitor Speaker Loudness + M Monitor Speaker Control + O Return to Online Data Mode + P Select Pulse Dialling + Q Result Code Suppression + S0 Automatic Answer Control + S10 Automatic Disconnect Delay Control + S3 Command Line Termination Character + S4 Response Formatting Character + S5 Command Line Editing Character (BACKSPACE) + S6 Blind Dial Delay Control + S7 Connection Completion Timeout + S8 Comma Dial Modifier Delay Control + T Select Tone Dialling + V DCE Response Format + X Call Progress Monitoring Control + Z Reset to Default Configuration Result codes: OK Acknowledge execution of a command CONNECT Connection has been established - RINGThe DCE has detected an incoming call signal from network - NO CARRIER The connection has been terminated, or attempt to establish - a connection failed + RINGThe DCE has detected an incoming call signal + from network + NO CARRIER The connection has been terminated, or attempt to + establish a connection failed ERROR Error NO DIALTONE No dial-tone detected BUSYBusy signal detected -- 1.7.1 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH 02/12] doc: Add BT HFP AT commands list
--- doc/dialup-command-set.txt | 38 ++ 1 files changed, 38 insertions(+), 0 deletions(-) diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt index 3e40aae..2067dfb 100644 --- a/doc/dialup-command-set.txt +++ b/doc/dialup-command-set.txt @@ -45,3 +45,41 @@ Result codes: ERROR Error NO DIALTONE No dial-tone detected BUSYBusy signal detected + +Bluetooth Hands-Free Profile Description += +(Ref. document: HFP1.5_SPEC (Car Working Group) - version V10r00 - 2005-11-25) + +- AT COMMAND set used: +Commands: + D Extension of the standard ATD command, intended for + memory dialing. Only voice calls are covered here + +CIND Standard indicator update AT command. + + +NREC Noise Reduction and Echo Canceling + +VGMGain of Microphone + +VGSGain of Speaker + +BINP Bluetooth INPut + +BLDN Bluetooth Last Dialed Number + +BVRA Bluetooth Voice Recognition Activation + +BRSF Bluetooth Retrieve Supported Features + +BTRH Bluetooth Response and Hold Feature + +CCWA + +CHLD + +CHUP + +CLCC + +COPS + +CMEE + +CLIP + +CMER + +VTS + +CNUM + +Unsolicited result: + +CIEV + +BSIR Bluetooth Setting of In-band Ring tone +Result codes: + NO ANSWER + DELAYED + BLACKLISTED + \ No newline at end of file -- 1.7.1 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH 00/12] doc: Add AT commands list to be supported in emulator
Hi, These patches only add a list of AT commands that should be added in the emulator. This list is not only related to bluetooth stuff. Olivier Guiter (12): doc: fix typo and incorrect line length doc: Add BT HFP AT commands list doc: Add AT command reference mark doc: Add AT commands for Call Management doc:Add AT commands for GPRS doc:Add AT commands for Network support doc: AT commands for supplementary services doc: AT commands for SMS doc: AT commands for device management doc: AT commands for SIM doc: Add AT command for debugging purpose doc: AT commands for Location based services doc/dialup-command-set.txt | 228 +--- 1 files changed, 194 insertions(+), 34 deletions(-) ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH 03/12] doc: Add AT command reference mark
--- doc/dialup-command-set.txt | 29 +++-- 1 files changed, 15 insertions(+), 14 deletions(-) diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt index 2067dfb..5d7a43d 100644 --- a/doc/dialup-command-set.txt +++ b/doc/dialup-command-set.txt @@ -11,9 +11,9 @@ Commands: D Circuit 108 (DTR) Response F Set to Factory Defined Configuration +GCAP Request Complete Capabilities List - +GMIRequest Manufacturer Identification - +GMMRead Model Identification - +GMRRead Revision Identification +* +GMIRequest Manufacturer Identification +* +GMMRead Model Identification +* +GMRRead Revision Identification A Answer Incoming Call D Dial E Command Echo @@ -64,17 +64,18 @@ Commands: +BVRA Bluetooth Voice Recognition Activation +BRSF Bluetooth Retrieve Supported Features +BTRH Bluetooth Response and Hold Feature - +CCWA - +CHLD - +CHUP - +CLCC - +COPS - +CMEE - +CLIP - +CMER - +VTS - +CNUM - +* +CCWA +* +CHLD +* +CHUP +* +CLCC +* +COPS +* +CMEE +* +CLIP +* +CMER +* +VTS +* +CNUM + (*: AT command referenced below) + Unsolicited result: +CIEV +BSIR Bluetooth Setting of In-band Ring tone -- 1.7.1 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH 04/12] doc: Add AT commands for Call Management
--- doc/dialup-command-set.txt | 17 + 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt index 5d7a43d..735d626 100644 --- a/doc/dialup-command-set.txt +++ b/doc/dialup-command-set.txt @@ -83,4 +83,21 @@ Result codes: NO ANSWER DELAYED BLACKLISTED + +AT commands supported in emulator: += + +Call management: + + +CBST Select bearer service type + +CHLD Standard call hold and multiparty handling AT command + +CHUP Hangup call + +CMOD Call mode + +CPAS Phone activity status + +CVHU Voice Hangup Control + +CLIP Calling line identification presentation + +CNUM Subscriber number + +VTSDTMF and tone generation + +CACM Accumulated Call Meter + +COLP Connected Line Identification Presentation \ No newline at end of file -- 1.7.1 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH 06/12] doc:Add AT commands for Network support
--- doc/dialup-command-set.txt | 10 +- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt index 2bec5e4..74b54ab 100644 --- a/doc/dialup-command-set.txt +++ b/doc/dialup-command-set.txt @@ -121,4 +121,12 @@ GPRS: +CGCLASSGPRS Mobile Station Class +DR Data Compression Reporting +DS Data Compression - \ No newline at end of file +Network: + + *CNTI Network RAT capabilities + +COPS PLMN selection + +CPOL Preferred PLMN list + +CREG Network registration + +CSQSignal quality + +CTZU Automatic Time Zone Update + +CTZR Time Zone Reporting -- 1.7.1 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH 07/12] doc: Add AT commands for supplementary services
--- doc/dialup-command-set.txt |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt index 74b54ab..a0599df 100644 --- a/doc/dialup-command-set.txt +++ b/doc/dialup-command-set.txt @@ -130,3 +130,11 @@ Network: +CSQSignal quality +CTZU Automatic Time Zone Update +CTZR Time Zone Reporting +Supplementary Services: +--- + +CCFC Call forwarding number and conditions + +CCWA Call waiting + +CLCC List current calls + +CLIR Calling line identification restriction + +CSSN Supplementary Service Notifications + +CUSD Unstructured supplementary service data -- 1.7.1 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH 05/12] doc:Add AT commands for GPRS
--- doc/dialup-command-set.txt | 21 + 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt index 735d626..2bec5e4 100644 --- a/doc/dialup-command-set.txt +++ b/doc/dialup-command-set.txt @@ -100,4 +100,25 @@ Call management: +VTSDTMF and tone generation +CACM Accumulated Call Meter +COLP Connected Line Identification Presentation +GPRS: +- + +CGACT PDP context activate or deactivate + +CGATT PS attach or detach + +CGCMOD PDP Context Modify + +CGDCONTDefine PDP Context + +CGEQREQ3G Quality of Service Profile (Requested) + +CGEQMIN3G Quality of Service Profile (Minimum acceptable) + +CGEQNEG3G Quality of Service Profile (Negotiated) + +CGQREQ Quality of Service Profile (Requested) + +CGQMIN Quality of Service Profile (Minimum Acceptable) + +CGREG GPRS network registration status + +CGDSCONT Define Secondary PDP Context + +CGDATA Enter Data State + +CGTFT Traffic Flow Template + +CGCMOD PDP Context Modify + +CGCLASSGPRS Mobile Station Class + +CGPADDRShow PDP address + +CGCLASSGPRS Mobile Station Class + +DR Data Compression Reporting + +DS Data Compression \ No newline at end of file -- 1.7.1 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH 08/12] doc: Add AT commands for SMS
--- doc/dialup-command-set.txt | 29 + 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt index a0599df..6480577 100644 --- a/doc/dialup-command-set.txt +++ b/doc/dialup-command-set.txt @@ -138,3 +138,32 @@ Supplementary Services: +CLIR Calling line identification restriction +CSSN Supplementary Service Notifications +CUSD Unstructured supplementary service data +SMS: + + +CMTI A GSM/GPRS modem or mobile phone uses +CMTI to notify + the computer / PC that a new SMS message has been + received and the memory location where it is stored. + +CMTA GSM/GPRS modem or mobile phone uses +CMT to forward + a newly received SMS message to the computer / PC. + +CGSMS Select service for MO SMS messages + +CMGF Message Format + +CMGS Send Message + +CSCA Service Centre Address + +CESP Enter SMS Block Mode Protocol + +CMGC Send Command + +CMGD Delete Message + +CMGL List Messages + +CMGR Read Message + +CMGW Write Message to Memory + +CMMS More Messages to Send + +CMSS Send Message from Storage + +CNMA New Message Acknowledgement to ME/TA + +CNMI New Message Indications to TE + +CPMS Preferred Message Storage + +CSCS Select TE Character Set + +CSCB Select Cell Broadcast Message Types + +CSDH Show Text Mode Parameters + +CSMP Set Text Mode Parameters + +CSMS Select Message Service + +CRES Restore Settings (SMS) + +CSAS Save Settings (SMS) -- 1.7.1 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH 09/12] doc: Add AT commands for device management
--- doc/dialup-command-set.txt | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt index 6480577..647d269 100644 --- a/doc/dialup-command-set.txt +++ b/doc/dialup-command-set.txt @@ -167,3 +167,21 @@ SMS: +CSMS Select Message Service +CRES Restore Settings (SMS) +CSAS Save Settings (SMS) +Device: + + +CBCBattery charge + +CBKLT Backlight + +CCLK Clock + +CSOCommand Screen Orientation + +CPWROFFSwitch off MS + +CPOS Positioning Control + +CSSCommand Screen Size + +CGMI Request manufacturer identification + +CGMM Request model identification + +CGMR Request revision identification + +GMIRequest Manufacturer Identification + +GMMRequest Model Identification + +GMRRequest Revision Identification + +CGSN Request product serial number identification + +CKPD Keypad control + -- 1.7.1 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH 11/12] doc: Add AT command for debugging purpose
--- doc/dialup-command-set.txt |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt index 97ff009..554707d 100644 --- a/doc/dialup-command-set.txt +++ b/doc/dialup-command-set.txt @@ -184,6 +184,7 @@ Device: +GMRRequest Revision Identification +CGSN Request product serial number identification +CKPD Keypad control + +TRACE Switch Trace ON/OFF SIM +CPBR Read phonebook entries -- 1.7.1 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH 10/12] doc: Add AT commands for SIM
--- doc/dialup-command-set.txt | 14 +- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt index 647d269..97ff009 100644 --- a/doc/dialup-command-set.txt +++ b/doc/dialup-command-set.txt @@ -184,4 +184,16 @@ Device: +GMRRequest Revision Identification +CGSN Request product serial number identification +CKPD Keypad control - +SIM + + +CPBR Read phonebook entries + +CPBS Select phonebook memory storage + +CPBW Write phonebook entry + +CPBF Find Phonebook Entries + +CPIN Enter PIN + +CRSM Restricted SIM access + +CSIM Generic SIM access + +CASIM SIM Slot + +CRES Restore Settings (SMS) + +CSAS Save Settings (SMS) + +CCID Request SIM Card Identification -- 1.7.1 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH 12/12] doc: Add AT commands for Location based services
--- doc/dialup-command-set.txt |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt index 554707d..f06033b 100644 --- a/doc/dialup-command-set.txt +++ b/doc/dialup-command-set.txt @@ -198,3 +198,8 @@ SIM +CRES Restore Settings (SMS) +CSAS Save Settings (SMS) +CCID Request SIM Card Identification +Location: +- + +CMOLR Mobile Originated Location Request + +CCLRAD Needed for clearing of old Assistance Data stored + for AGPS positioning -- 1.7.1 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH 04/12] src: add gnss atom and agent implementation
Hi Denis, On Fri, 2011-03-18 at 06:39 +0200, Denis Kenzior wrote: Hi Jarko, On 03/11/2011 06:23 AM, Jarko Poutiainen wrote: --- Makefile.am |3 +- src/gnss.c | 357 +++ src/gnssagent.c | 152 +++ src/gnssagent.h | 40 ++ 4 files changed, 551 insertions(+), 1 deletions(-) create mode 100644 src/gnss.c create mode 100644 src/gnssagent.c create mode 100644 src/gnssagent.h diff --git a/Makefile.am b/Makefile.am index 7d6acce..24742bb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -383,7 +383,8 @@ src_ofonod_SOURCES = $(gdbus_sources) $(builtin_sources) src/ofono.ver \ src/smsagent.c src/smsagent.h src/ctm.c \ src/cdma-voicecall.c src/sim-auth.c \ src/message.h src/message.c src/gprs-provision.c \ - src/emulator.c src/location-reporting.c + src/emulator.c src/location-reporting.c \ + src/gnss.c src/gnssagent.c src/gnssagent.h src_ofonod_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ @CAPNG_LIBS@ -ldl diff --git a/src/gnss.c b/src/gnss.c new file mode 100644 index 000..02f9057 --- /dev/null +++ b/src/gnss.c @@ -0,0 +1,357 @@ +/* + * + * oFono - Open Source Telephony + * + * Copyright (C) 2008-2010 Intel Corporation. All rights reserved. + * Copyright (C) 2011 ST-Ericsson AB. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include config.h +#endif + +#define _GNU_SOURCE +#include string.h +#include stdio.h +#include stdlib.h +#include stdint.h + +#include glib.h +#include gdbus.h +#include errno.h + +#include ofono.h + +#include common.h +#include gnssagent.h + +static GSList *g_drivers = NULL; + +struct ofono_gnss { + const struct ofono_gnss_driver *driver; + void *driver_data; + struct ofono_atom *atom; + DBusMessage *pending; + struct gnss_agent *default_agent; Why is this called default_agent? posr_agent might be a better name Good point. I will change that. Wasn't sure how I should implement this at first and later just forgot to change the name +}; + +static void gnss_register_agent_cb(const struct ofono_error *error, + void *data) +{ + DBusMessage *reply; + struct ofono_gnss *gnss = data; + + DBG(); + + if (error-type != OFONO_ERROR_TYPE_NO_ERROR) { + ofono_error(Enabling Location Reporting Failed); + reply = __ofono_error_failed(gnss-pending); + gnss_agent_free(gnss-default_agent); + __ofono_dbus_pending_reply(gnss-pending, reply); + return; + } + + reply = dbus_message_new_method_return(gnss-pending); + __ofono_dbus_pending_reply(gnss-pending, reply); +} + +static void default_agent_notify(gpointer user_data) Why is this called default_agent_notify? Can you have multiple agents? If not, then agent_notify is sufficient. No. At least I don't see a need. +{ + struct ofono_gnss *gnss = user_data; + + gnss-default_agent = NULL; Since you're enabling CPOSR when an agent is registered, you have to also guard against the case of the application exiting. Note that the agent can even exit while your CPOSR enable is in progress. Have a peek at location-reporting.c for ideas on how Lucas solved this. Not sure if I understood correctly what you're trying to say and checking location-reporting.c didn't help but I can change the order in which things are done i.e. I can create agent first and then enable CPOSR. That way if the client dies we will know and can destroy the agent. +} + +static DBusMessage *gnss_register_agent(DBusConnection *conn, + DBusMessage *msg, void *data) +{ + struct ofono_gnss *gnss = data; + const char *agent_path; + + if (gnss-pending) + return __ofono_error_busy(msg); + + if (gnss-default_agent) + return __ofono_error_busy(msg); + + if (dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, +
Re: [PATCH 09/12] atmodem: add gnss driver
Hi Denis, On Fri, 2011-03-18 at 07:03 +0200, Denis Kenzior wrote: On 03/11/2011 06:23 AM, Jarko Poutiainen wrote: --- Makefile.am |3 +- drivers/atmodem/atmodem.c |2 + drivers/atmodem/atmodem.h |3 + drivers/atmodem/gnss.c| 279 + 4 files changed, 286 insertions(+), 1 deletions(-) create mode 100644 drivers/atmodem/gnss.c diff --git a/Makefile.am b/Makefile.am index 24742bb..3dae7f4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -180,7 +180,8 @@ builtin_sources += $(gatchat_sources) \ drivers/atmodem/atutil.c \ drivers/atmodem/gprs.c \ drivers/atmodem/gprs-context.c \ - drivers/atmodem/sim-auth.c + drivers/atmodem/sim-auth.c \ + drivers/atmodem/gnss.c builtin_modules += nwmodem builtin_sources += drivers/atmodem/atutil.h \ diff --git a/drivers/atmodem/atmodem.c b/drivers/atmodem/atmodem.c index e140281..3093c23 100644 --- a/drivers/atmodem/atmodem.c +++ b/drivers/atmodem/atmodem.c @@ -52,6 +52,7 @@ static int atmodem_init(void) at_gprs_init(); at_gprs_context_init(); at_sim_auth_init(); + at_gnss_init(); return 0; } @@ -76,6 +77,7 @@ static void atmodem_exit(void) at_call_volume_exit(); at_gprs_exit(); at_gprs_context_exit(); + at_gnss_exit(); } OFONO_PLUGIN_DEFINE(atmodem, AT modem driver, VERSION, diff --git a/drivers/atmodem/atmodem.h b/drivers/atmodem/atmodem.h index 1b7cf67..1a73b84 100644 --- a/drivers/atmodem/atmodem.h +++ b/drivers/atmodem/atmodem.h @@ -74,3 +74,6 @@ extern void at_gprs_context_exit(void); extern void at_sim_auth_init(void); extern void at_sim_auth_exit(void); + +extern void at_gnss_init(void); +extern void at_gnss_exit(void); diff --git a/drivers/atmodem/gnss.c b/drivers/atmodem/gnss.c new file mode 100644 index 000..c1b1de3 --- /dev/null +++ b/drivers/atmodem/gnss.c @@ -0,0 +1,279 @@ +/* + * + * oFono - Open Source Telephony + * + * Copyright (C) 2008-2010 Intel Corporation. All rights reserved. + * Copyright (C) 2011 ST-Ericsson AB. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include config.h +#endif + +#define _GNU_SOURCE +#include string.h +#include stdlib.h +#include stdio.h +#include errno.h + +#include glib.h + +#include ofono/log.h +#include ofono/modem.h +#include ofono/gnss.h + +#include gatchat.h +#include gatresult.h + +#include atmodem.h +#include vendor.h + +struct gnss_data { + GAtChat *chat; + unsigned int vendor; +}; + +static const char *none_prefix[] = { NULL }; +static const char *cpos_prefix[] = { +CPOS:, NULL }; +static const char *cposr_prefix[] = { +CPOSR:, NULL }; + +static void gnsspr_cb(gboolean ok, GAtResult *result, gpointer user_data) +{ + struct cb_data *cbd = user_data; + ofono_gnss_position_report_cb_t cb = cbd-cb; + + DBG(); + + if (ok) + CALLBACK_WITH_SUCCESS(cb, cbd-data); + else + CALLBACK_WITH_FAILURE(cb, cbd-data); As a general habit, please use at_util_decode_error instead of using these macros. This leads to simpler code as well Thanks I will do that +} + +static void at_gnss_position_reporting(struct ofono_gnss *gnss, + ofono_bool_t enable, + ofono_gnss_position_report_cb_t cb, + void *data) +{ + struct gnss_data *ad = ofono_gnss_get_data(gnss); + struct cb_data *cbd = cb_data_new(cb, data); + + DBG(); + + if (enable) { + g_at_chat_send(ad-chat, AT+CPOSR=1, + cposr_prefix, gnsspr_cb, cbd, g_free); + + if (ad-vendor == OFONO_VENDOR_STE) + g_at_chat_send(ad-chat, AT*EPOSADRR=1, + NULL, NULL, NULL, NULL); + } else { + g_at_chat_send(ad-chat, AT+CPOSR=0, + cposr_prefix, gnsspr_cb, cbd, g_free); + + if (ad-vendor
Re: [PATCH] call-forwarding: fix for showing call forwarding states
Hi, On Thu, 2011-03-17 at 17:00 +0200, Denis Kenzior wrote: Hi Jussi, So correct me if I'm wrong, but I don't think we can do that. the current cf_conditions implementation stores all conditions, which could be unrelated to voice; and if my interpretation of 22.004 is correct you can have something like this: Activate CFB for all services to Number 1 Activate CFU for Data services to Number 2 Which results in cf_conditions[CALL_FORWARDING_TYPE_UNCONDITIONAL] not being NULL and you reporting CFB for voice incorrectly. You are probably safer using is_cfu_enabled() function. As far as I know scenario you describe cannot happen with oFono. There is no data related conditions in the call forwarding API. Sure, you can set data forwarding on using SS API, but I don't see how data forwarding states could be shown in call forwarding API when all states in API start with word voice. Also according to comments in code fax and data are not supported. It can. oFono stores _all_ conditions in its lists. However, it filters them when reporting the conditions in get_properties or signals. This is why is_cfu_enabled function looks the way it does. So a scenario like this is fully possible. Not to mention that the CFs are queried for all services by default. All right. I have no access to network that would support data forwarding or my modem does not support it so I cannot verify this in practice. But I think problem can be avoided by changing the line if (cf-cf_conditions[CALL_FORWARDING_TYPE_UNCONDITIONAL] == NULL) { to if (!is_cfu_enabled(cf, NULL)) { Of course little bit optimization would be good to avoid second calling of this method later in function. Moving the setting of status variable above these and using it when checked if UNCONDITIONAL is on instead of is_cfu_enabled seems to be working nicely. Br, -Jussi ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH 07/12] gatchat: implementation for +CPOS send
Hi Denis, On Fri, 2011-03-18 at 06:42 +0200, Denis Kenzior wrote: Hi Jarko, On 03/11/2011 06:23 AM, Jarko Poutiainen wrote: --- gatchat/gatchat.c | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c index 3fd564d..64f131d 100644 --- a/gatchat/gatchat.c +++ b/gatchat/gatchat.c @@ -1468,6 +1468,19 @@ guint g_at_chat_send_pdu_listing(GAtChat *chat, const char *cmd, listing, func, user_data, notify); } +guint g_at_chat_send_and_expect_short_prompt(GAtChat *chat, const char *cmd, + const char **prefix_list, GAtResultFunc func, + gpointer user_data, GDestroyNotify notify) +{ + if(chat != NULL) + chat-parent-syntax-set_hint(chat-parent-syntax, + G_AT_SYNTAX_EXPECT_SHORT_PROMPT); So unfortunately you can't do this. GAtChat is a command queue and we might be in the process of sending / receiving responses for multiple commands that are ahead of this one. So you can't really manipulate the syntax directly here. You have to do this only once the CPOSR has been sent on the wire. Ok, thanks. Still having trouble to understand GAtChat. Not just sure where I should set the hint then but I get your point. Now I'm also a little confused because previously you suggested that I'd make a new g_at_chat_send variant that would set the hint so what did you mean by it then if not this? + + return at_chat_send_common(chat-parent, chat-group, + cmd, prefix_list, FALSE, NULL, + func, user_data, notify); +} + gboolean g_at_chat_cancel(GAtChat *chat, guint id) { /* We use id 0 for wakeup commands */ Regards, -Denis Br, Jarko ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH] Fix a memory leak reported by cppcheck.
--- src/smsutil.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/src/smsutil.c b/src/smsutil.c index 5524932..e781399 100644 --- a/src/smsutil.c +++ b/src/smsutil.c @@ -3344,7 +3344,7 @@ void sms_tx_backup_free(const char *imsi, unsigned long id, len = scandir(path, entries, NULL, versionsort); if (len 0) - return; + goto nodir_exit; /* skip '..' and '.' entries */ while (len-- 2) { @@ -3362,6 +3362,8 @@ void sms_tx_backup_free(const char *imsi, unsigned long id, g_free(entries); rmdir(path); + +nodir_exit: g_free(path); } -- 1.7.1 - Intel Corporation SAS (French simplified joint stock company) Registered headquarters: Les Montalets- 2, rue de Paris, 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH 08/12] gatchat: fix gatsyntax to support +CPOS
Hi Denis, On Fri, 2011-03-18 at 06:53 +0200, Denis Kenzior wrote: Hi Jarko, On 03/11/2011 06:23 AM, Jarko Poutiainen wrote: --- gatchat/gatsyntax.c | 19 +++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/gatchat/gatsyntax.c b/gatchat/gatsyntax.c index 2fc70b8..f1d896b 100644 --- a/gatchat/gatsyntax.c +++ b/gatchat/gatsyntax.c @@ -64,6 +64,9 @@ static void gsmv1_hint(GAtSyntax *syntax, GAtSyntaxExpectHint hint) case G_AT_SYNTAX_EXPECT_MULTILINE: syntax-state = GSMV1_STATE_GUESS_MULTILINE_RESPONSE; break; + case G_AT_SYNTAX_EXPECT_SHORT_PROMPT: + syntax-state = GSMV1_STATE_PROMPT; + break; default: break; }; @@ -195,6 +198,13 @@ static GAtSyntaxResult gsmv1_feed(GAtSyntax *syntax, i += 1; res = G_AT_SYNTAX_RESULT_PROMPT; goto out; + } else if (byte == '\r') + break; + else if (byte == '\n') { + syntax-state = GSMV1_STATE_IDLE; + i += 1; + res = G_AT_SYNTAX_RESULT_PROMPT; + goto out; Please just create a dedicated state for this one and don't hack the PROMPT state. Ok, good point. } syntax-state = GSMV1_STATE_RESPONSE; @@ -239,6 +249,8 @@ static void gsm_permissive_hint(GAtSyntax *syntax, GAtSyntaxExpectHint hint) { if (hint == G_AT_SYNTAX_EXPECT_PDU) syntax-state = GSM_PERMISSIVE_STATE_GUESS_PDU; + else if (hint == G_AT_SYNTAX_EXPECT_SHORT_PROMPT) + syntax-state = GSM_PERMISSIVE_STATE_PROMPT; } static GAtSyntaxResult gsm_permissive_feed(GAtSyntax *syntax, @@ -298,6 +310,13 @@ static GAtSyntaxResult gsm_permissive_feed(GAtSyntax *syntax, i += 1; res = G_AT_SYNTAX_RESULT_PROMPT; goto out; + } else if (byte == '\r') + break; + else if (byte == '\n') { + syntax-state = GSM_PERMISSIVE_STATE_IDLE; + i += 1; + res = G_AT_SYNTAX_RESULT_PROMPT; + goto out; Same comment here, and man you better pray that your modem doesn't insert unsolicited notifications between you sending a CPOSR and you receiving a prompt ;) Yep. Btw now that I think about it, shouldn't the patch that I proposed to ste.c help? I know it's ste specific solution but still.. } syntax-state = GSM_PERMISSIVE_STATE_RESPONSE; Regards, -Denis Br, Jarko ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH 04/12] src: add gnss atom and agent implementation
Hi Jarko, +{ + struct ofono_gnss *gnss = user_data; + + gnss-default_agent = NULL; Since you're enabling CPOSR when an agent is registered, you have to also guard against the case of the application exiting. Note that the agent can even exit while your CPOSR enable is in progress. Have a peek at location-reporting.c for ideas on how Lucas solved this. Not sure if I understood correctly what you're trying to say and checking location-reporting.c didn't help but I can change the order in which things are done i.e. I can create agent first and then enable CPOSR. That way if the client dies we will know and can destroy the agent. Basically what I'm seeing is that when the application calls: RegisterPositioningReportingAgent you trigger CPOSR=1 to the modem and return a reply to the application in the CPOSR callback. When the application unregisters the agent, you trigger CPOSR=0 to the modem and remove the agent in the callback. Now consider what happens if the application that registered the agent crashes or exits without unregistering the agent. Your CPOSR reporting is still turned on, without anyone around to handle the request. You can handle this in a couple of ways: - Always turn on CPOSR in the driver and get rid of the set_position_reporting function. Any requests going to the core with no agent registered go to /dev/null (since I don't see a CPOS 'abort' style functionality. - Make sure that CPOSR is reset back to zero in both cases described above. Regards, -Denis ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH 09/12] atmodem: add gnss driver
Hi Jarko, +static gboolean gnss_parse_report(GAtResult *result, const char *prefix, + const char **xml) +{ + GAtResultIter iter; + + g_at_result_iter_init(iter, result); + + if (!g_at_result_iter_next(iter, prefix)) + return FALSE; + + if (!g_at_result_iter_next_unquoted_string(iter, xml)) + return FALSE; + + return TRUE; Do you really need a separate function? This might belong in gnss_report I just thought that it would be more logical to have separate function to parse the result rather than putting it all in to same function. Is that a big deal or do you want me to change that? This is not really wrong, was just wondering. Leave it as is for now. Regards, -Denis ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH 08/12] gatchat: fix gatsyntax to support +CPOS
Hi Jarko, @@ -298,6 +310,13 @@ static GAtSyntaxResult gsm_permissive_feed(GAtSyntax *syntax, i += 1; res = G_AT_SYNTAX_RESULT_PROMPT; goto out; + } else if (byte == '\r') + break; + else if (byte == '\n') { + syntax-state = GSM_PERMISSIVE_STATE_IDLE; + i += 1; + res = G_AT_SYNTAX_RESULT_PROMPT; + goto out; Same comment here, and man you better pray that your modem doesn't insert unsolicited notifications between you sending a CPOSR and you receiving a prompt ;) Yep. Btw now that I think about it, shouldn't the patch that I proposed to ste.c help? I know it's ste specific solution but still.. If you mean running GNSS on a dedicated mux channel, then yes it will help ;) But really, using a proper prompt would be way better. Regards, -Denis ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH 07/12] gatchat: implementation for +CPOS send
Hi Jarko, +guint g_at_chat_send_and_expect_short_prompt(GAtChat *chat, const char *cmd, + const char **prefix_list, GAtResultFunc func, + gpointer user_data, GDestroyNotify notify) +{ + if(chat != NULL) + chat-parent-syntax-set_hint(chat-parent-syntax, + G_AT_SYNTAX_EXPECT_SHORT_PROMPT); So unfortunately you can't do this. GAtChat is a command queue and we might be in the process of sending / receiving responses for multiple commands that are ahead of this one. So you can't really manipulate the syntax directly here. You have to do this only once the CPOSR has been sent on the wire. Ok, thanks. Still having trouble to understand GAtChat. Not just sure where I should set the hint then but I get your point. Now I'm also a little confused because previously you suggested that I'd make a new g_at_chat_send variant that would set the hint so what did you mean by it then if not this? Look at how e.g. expect_pdu boolean is handled. You need to do something very similar but after sending the first chunk followed by \r. (e.g. when AT+CPOS\r was sent). You probably need to add another flag/boolean to the command data structure for this. Regards, -Denis ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH 0/1] Fix issue in ifx nitz time reporting
Hi, CTZDST will be reported only if the network daylight saving time is received from network as part of the MM information message. Due to this, time was not reported to the core. Fix is to schedule the timer once the CTZV is received. This way, time information will be reported always and also only once as expected. Regards, Jeevaka Jeevaka Badrappan (1): atmodem: fix issue in time reporting with ifx drivers/atmodem/network-registration.c | 25 +++-- 1 files changed, 23 insertions(+), 2 deletions(-) ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH 1/1] atmodem: fix issue in time reporting with ifx
--- drivers/atmodem/network-registration.c | 25 +++-- 1 files changed, 23 insertions(+), 2 deletions(-) diff --git a/drivers/atmodem/network-registration.c b/drivers/atmodem/network-registration.c index 4913611..0dbc72d 100644 --- a/drivers/atmodem/network-registration.c +++ b/drivers/atmodem/network-registration.c @@ -58,6 +58,7 @@ struct netreg_data { int signal_max; /* max strength reported via CIND */ int tech; struct ofono_network_time time; + guint nitz_source; unsigned int vendor; }; @@ -691,6 +692,18 @@ static void ctzv_notify(GAtResult *result, gpointer user_data) ofono_netreg_time_notify(netreg, nd-time); } +static gboolean notify_time(gpointer user_data) +{ + struct ofono_netreg *netreg = user_data; + struct netreg_data *nd = ofono_netreg_get_data(netreg); + + nd-nitz_source = 0; + + ofono_netreg_time_notify(netreg, nd-time); + + return FALSE; +} + static void ifx_ctzv_notify(GAtResult *result, gpointer user_data) { struct ofono_netreg *netreg = user_data; @@ -722,6 +735,11 @@ static void ifx_ctzv_notify(GAtResult *result, gpointer user_data) nd-time.mday = mday; nd-time.mon = mon; nd-time.year = 2000 + year; + + if (nd-nitz_source) + g_source_remove(nd-nitz_source); + + nd-nitz_source = g_timeout_add(0, notify_time, user_data); } static void ifx_ctzdst_notify(GAtResult *result, gpointer user_data) @@ -742,8 +760,6 @@ static void ifx_ctzdst_notify(GAtResult *result, gpointer user_data) DBG(dst %d, dst); nd-time.dst = dst; - - ofono_netreg_time_notify(netreg, nd-time); } static void cind_cb(gboolean ok, GAtResult *result, gpointer user_data) @@ -1367,6 +1383,11 @@ static void at_netreg_remove(struct ofono_netreg *netreg) { struct netreg_data *nd = ofono_netreg_get_data(netreg); + if (nd-nitz_source) { + g_source_remove(nd-nitz_source); + nd-nitz_source = 0; + } + ofono_netreg_set_data(netreg, NULL); g_at_chat_unref(nd-chat); -- 1.7.0.4 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH 00/12] doc: Add AT commands list to be supported in emulator
Hi Olivier, These patches only add a list of AT commands that should be added in the emulator. This list is not only related to bluetooth stuff. Applying: doc: fix typo and incorrect line length /data/devel/ofono/.git/rebase-apply/patch:84: trailing whitespace. RINGThe DCE has detected an incoming call signal fatal: 1 line adds whitespace errors. Regards Marcel ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH 1/2] emulator: add defines for call, callsetup and callheld indicators
--- include/emulator.h | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/include/emulator.h b/include/emulator.h index 71b7c24..5cd894b 100644 --- a/include/emulator.h +++ b/include/emulator.h @@ -36,6 +36,18 @@ extern C { #define OFONO_EMULATOR_IND_SERVICE service #define OFONO_EMULATOR_IND_SIGNAL signal +#define OFONO_EMULATOR_CALL_INACTIVE 0 +#define OFONO_EMULATOR_CALL_ACTIVE 1 + +#define OFONO_EMULATOR_CALLSETUP_INACTIVE 0 +#define OFONO_EMULATOR_CALLSETUP_INCOMING 1 +#define OFONO_EMULATOR_CALLSETUP_OUTGOING 2 +#define OFONO_EMULATOR_CALLSETUP_ALERTING 3 + +#define OFONO_EMULATOR_CALLHELD_NONE 0 +#define OFONO_EMULATOR_CALLHELD_MULTIPLE 1 +#define OFONO_EMULATOR_CALLHELD_ON_HOLD 2 + struct ofono_emulator; struct ofono_emulator_request; -- 1.7.1 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH 2/2] emulator: add call, callsetup and callheld indicators
--- src/emulator.c |5 +++ src/voicecall.c | 92 +++ 2 files changed, 97 insertions(+), 0 deletions(-) diff --git a/src/emulator.c b/src/emulator.c index c84f0a9..2707592 100644 --- a/src/emulator.c +++ b/src/emulator.c @@ -455,6 +455,11 @@ void ofono_emulator_register(struct ofono_emulator *em, int fd) if (em-type == OFONO_EMULATOR_TYPE_HFP) { emulator_add_indicator(em, OFONO_EMULATOR_IND_SERVICE, 0, 1, 0); + emulator_add_indicator(em, OFONO_EMULATOR_IND_CALL, 0, 1, 0); + emulator_add_indicator(em, OFONO_EMULATOR_IND_CALLSETUP, 0, 3, + 0); + emulator_add_indicator(em, OFONO_EMULATOR_IND_CALLHELD, 0, 2, + 0); emulator_add_indicator(em, OFONO_EMULATOR_IND_SIGNAL, 0, 5, 0); emulator_add_indicator(em, OFONO_EMULATOR_IND_ROAMING, 0, 1, 0); emulator_add_indicator(em, OFONO_EMULATOR_IND_BATTERY, 0, 5, 5); diff --git a/src/voicecall.c b/src/voicecall.c index cb5258d..f86d478 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -59,6 +59,7 @@ struct ofono_voicecall { struct dial_request *dial_req; GQueue *toneq; guint tone_source; + unsigned int hfp_watch; }; struct voicecall { @@ -101,6 +102,7 @@ static const char *default_en_list_no_sim[] = { 119, 118, 999, 110, static void generic_callback(const struct ofono_error *error, void *data); static void multirelease_callback(const struct ofono_error *err, void *data); static gboolean tone_request_run(gpointer user_data); +static gboolean voicecalls_have_with_status(struct ofono_voicecall *vc, int status); static gint call_compare_by_id(gconstpointer a, gconstpointer b) { @@ -692,6 +694,69 @@ static void voicecall_emit_multiparty(struct voicecall *call, gboolean mpty) val); } +static void emulator_call_status_cb(struct ofono_atom *atom, void *data) +{ + struct ofono_emulator *em = __ofono_atom_get_data(atom); + + ofono_emulator_set_indicator(em, OFONO_EMULATOR_IND_CALL, + GPOINTER_TO_INT(data)); +} + +static void emulator_callsetup_status_cb(struct ofono_atom *atom, void *data) +{ + struct ofono_emulator *em = __ofono_atom_get_data(atom); + + ofono_emulator_set_indicator(em, OFONO_EMULATOR_IND_CALLSETUP, + GPOINTER_TO_INT(data)); +} + +static void emulator_callheld_status_cb(struct ofono_atom *atom, void *data) +{ + struct ofono_emulator *em = __ofono_atom_get_data(atom); + + ofono_emulator_set_indicator(em, OFONO_EMULATOR_IND_CALLHELD, + GPOINTER_TO_INT(data)); +} + +static void notify_emulator_call_status(struct ofono_voicecall *vc) +{ + struct ofono_modem *modem = __ofono_atom_get_modem(vc-atom); + int status; + + status = voicecalls_have_with_status(vc, CALL_STATUS_ACTIVE) ? + OFONO_EMULATOR_CALL_ACTIVE : + OFONO_EMULATOR_CALL_INACTIVE; + __ofono_modem_foreach_atom(modem, OFONO_ATOM_TYPE_EMULATOR_HFP, + emulator_call_status_cb, + GINT_TO_POINTER(status)); + + if (voicecalls_have_with_status(vc, CALL_STATUS_HELD)) { + if (status) + status = OFONO_EMULATOR_CALLHELD_MULTIPLE; + else + status = OFONO_EMULATOR_CALLHELD_ON_HOLD; + } else + status = OFONO_EMULATOR_CALLHELD_NONE; + + __ofono_modem_foreach_atom(modem, OFONO_ATOM_TYPE_EMULATOR_HFP, + emulator_callheld_status_cb, + GINT_TO_POINTER(status)); + + if (voicecalls_have_with_status(vc, CALL_STATUS_DIALING)) + status = OFONO_EMULATOR_CALLSETUP_OUTGOING; + else if (voicecalls_have_with_status(vc, CALL_STATUS_ALERTING)) + status = OFONO_EMULATOR_CALLSETUP_ALERTING; + else if (voicecalls_have_with_status(vc, CALL_STATUS_INCOMING) + || voicecalls_have_with_status(vc, CALL_STATUS_WAITING)) + status = OFONO_EMULATOR_CALLSETUP_INCOMING; + else + status = OFONO_EMULATOR_CALLSETUP_INACTIVE; + + __ofono_modem_foreach_atom(modem, OFONO_ATOM_TYPE_EMULATOR_HFP, + emulator_callsetup_status_cb, + GINT_TO_POINTER(status)); +} + static void voicecall_set_call_status(struct voicecall *call, int status) { DBusConnection *conn = ofono_dbus_get_connection(); @@ -714,6 +779,8 @@ static void
Re: [RESEND 3 PATCH 00/13] IPv6 Support
Hi Mika, On 03/18/2011 03:33 AM, mika.liljeb...@nokia.com wrote: Hi Denis, Disabling IPv6 stateless address would be a bold move indeed, since it is declared mandatory in both IETF and 3GPP standards. Please see [RFC4294] and [3GPP 23.060]. The section Dynamic IPv6 Address Allocation in 23.060 is very clear on how IPv6 address allocation in 3GPPP networks is done. See also the section about IPv6 prefix delegation (relevant to IPv6 tethering) and applicable parts of 24.008. This still needs to be figured out. We are aware that autoconfiguration is mandatory in 3GPP. However, this seems to be going against 27.007. There is no contradiction. Let me explain what I mean. The 3GPP standards mostly talk about MS (mobile station) which comprises of both TE and MT (terminal equipment and modem terminal). As such, 3GPP specifications place requirements on both TE and MT. The 27.007 defines a TA (terminal adapter), which is one possible interface between TE and MT. However, 27.007 is not mandatory, vendor specific interfaces are also allowed. As a consequence other interfaces, such as ISI and CAIF, also exist. No arguments here While stateless address autoconfiguration is mandatory for MS, a funky AT modem could potentially have an internal IPv6 stack as part of the TA function and perform address configuration against the network and then proxy any IPv6 traffic between the TE and the network. This would meet the requirements of 3GPP. The *intent* in the 3GPP standards is that TEs can behave as standard IPv6 hosts (so PCs can use a standard IPv6 stack), which means that the TE is expected to run the autoconfiguration protocols against the network in the normal case. Nothing in 27.007 specifically prevents that. The static address configuration parameters in the AT commands are optional and will simply be missing, if the modem just acts as a bitpipe between TE and the network, allowing the TE to run its IPv6 stack in the normal way. However, a funky AT modem that implements an IPv6 stack internally and exposes static address configuration parameters towards TE is certainly possible. Such a modem would presumably also block the router advertisements coming from the network, which would effectively disable stateless address autoconfiguration for the TE. This is not something you need or should do in connman. Standard IPv6 stack is sufficient. So in the end both might be required. On this I agree. Stateless address autoconfiguration is needed because it is mandatory in both IETF and 3GPP standards (sorry for the repetition). Static configuration (optional in IETF standards) may also be needed but that remains to be seen. It depends on what kind of funky AT modems are and will be out there. So you seem to agree as well, and hence why our IPv6 API is the way it is right now. In the end oFono's philosophy is to always err on the side of 27.007. So far this strategy has never been (completely) wrong. 27.007 provides a nice checklist for the functionality of the modem, so in that sense you're right. In another way it also serves as a lowest common denominator for the same functionality. However, what 27.007 does not do is specify system behaviour. It's easy to jump to conclusions just by looking at what AT commands are available. Most of the commands are optional, because a lot of freedom has intentionally been left for the implementors. It is also why, IMO, the specification is so bad and we have to fight with all these quirky AT modem implementations. Unfortunately that ship has sailed. Every vendor except Nokia uses AT command modems, or at least implements a (somewhat) full-featured AT backend. oFono is not about to start inventing its own standard and then try to merge differences between e.g. ISI 2.0, ISI 2.5, AT commands, CAIF, QCDM, etc. If the industry couldn't agree on a proper standard protocol, then I doubt oFono will be able to. And we're not about to start switch/casing modem types in the core. That way leads to chaos. We chose this path two years ago and have been pretty successful with it. Complaining about this now is the wrong time. If your protocol is different from 27.007, then it just means extra pain for the modem driver writer. But as you mentioned, 27.007 is the lowest common denominator and the vendor specific protocols are richer. So implementing 27.007 behavior is usually workable (though not always easy) The core tries to help you whenever possible here and deviates from 27.007 when really necessary, but I'm not tempted to stray too far from it. Don't get me wrong, 27.007 is a pain and you've seen me complaining about its 'peculiarities' often, but it is the best thing we have right now. Remember that 3GPP standards specify the behavour between MS and the nework. I.e., they place requirements on both TE and MT. The AT interface (TA function) stands in between and
Re: [PATCH] Fix a memory leak reported by cppcheck.
Hi Bertrand, On 03/18/2011 08:18 AM, Bertrand Aygon wrote: --- src/smsutil.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) Nice catch, patch has been applied, thanks. Regards, -Denis ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH] call-forwarding: fix for showing call forwarding states
Hi Jussi, On 03/18/2011 07:53 AM, Jussi Kangas wrote: Hi, On Thu, 2011-03-17 at 17:00 +0200, Denis Kenzior wrote: Hi Jussi, So correct me if I'm wrong, but I don't think we can do that. the current cf_conditions implementation stores all conditions, which could be unrelated to voice; and if my interpretation of 22.004 is correct you can have something like this: Activate CFB for all services to Number 1 Activate CFU for Data services to Number 2 Which results in cf_conditions[CALL_FORWARDING_TYPE_UNCONDITIONAL] not being NULL and you reporting CFB for voice incorrectly. You are probably safer using is_cfu_enabled() function. As far as I know scenario you describe cannot happen with oFono. There is no data related conditions in the call forwarding API. Sure, you can set data forwarding on using SS API, but I don't see how data forwarding states could be shown in call forwarding API when all states in API start with word voice. Also according to comments in code fax and data are not supported. It can. oFono stores _all_ conditions in its lists. However, it filters them when reporting the conditions in get_properties or signals. This is why is_cfu_enabled function looks the way it does. So a scenario like this is fully possible. Not to mention that the CFs are queried for all services by default. All right. I have no access to network that would support data forwarding or my modem does not support it so I cannot verify this in practice. But I think problem can be avoided by changing the line if (cf-cf_conditions[CALL_FORWARDING_TYPE_UNCONDITIONAL] == NULL) { to if (!is_cfu_enabled(cf, NULL)) { Of course little bit optimization would be good to avoid second calling of this method later in function. Moving the setting of status variable above these and using it when checked if UNCONDITIONAL is on instead of is_cfu_enabled seems to be working nicely. Yes, lets do the optimization since its quite easy. Regards, -Denis ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH v2 0/1] Fix issue in ifx nitz time reporting
Hi, CTZDST will be reported only if the network daylight saving time is received from network as part of the MM information message. Due to this, time was not reported to the core. Fix is to schedule the timer once the CTZV is received. This way, time information will be reported always and also only once as expected. Regards, Jeevaka Jeevaka Badrappan (1): atmodem: fix issue in time reporting with ifx drivers/atmodem/network-registration.c | 26 ++ 1 files changed, 26 insertions(+), 0 deletions(-) ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH v2 1/1] atmodem: fix issue in time reporting with ifx
Hi Jeevaka, drivers/atmodem/network-registration.c | 26 ++ 1 files changed, 26 insertions(+), 0 deletions(-) patch has been applied. Thanks. Regards Marcel ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH v2 6/9] emulator: add CKPD support
Hi Frédéric, On 03/17/2011 01:55 PM, Frédéric Dalleau wrote: --- src/emulator.c | 30 ++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/src/emulator.c b/src/emulator.c index ce3fabd..1d4fbc6 100644 --- a/src/emulator.c +++ b/src/emulator.c @@ -387,6 +387,34 @@ fail: } } +static void ckpd_cb(GAtServer *server, GAtServerRequestType type, + GAtResult *result, gpointer user_data) +{ + switch (type) { + case G_AT_SERVER_REQUEST_TYPE_SET: + { + GAtResultIter iter; + int key; + g_at_result_iter_init(iter, result); + g_at_result_iter_next(iter, ); + + if (g_at_result_iter_next_number(iter, key) == FALSE) + goto fail; + + if (key != 200) + goto fail; + + g_at_server_send_final(server, G_AT_SERVER_RESULT_OK); + break; + } + + default: +fail: + g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR); + break; + } +} Do you have a plan on what to do with these key presses? + static void emulator_add_indicator(struct ofono_emulator *em, const char* name, int min, int max, int dflt) { @@ -462,6 +490,8 @@ void ofono_emulator_register(struct ofono_emulator *em, int fd) g_at_server_register(em-server, +BRSF, brsf_cb, em, NULL); g_at_server_register(em-server, +CIND, cind_cb, em, NULL); g_at_server_register(em-server, +CMER, cmer_cb, em, NULL); + } else if (em-type == OFONO_EMULATOR_TYPE_HSP) { + g_at_server_register(em-server, +CKPD, ckpd_cb, em, NULL); } __ofono_atom_register(em-atom, emulator_unregister); Regards, -Denis ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH v2 1/9] bluetooth: add functions for sco connection
Hi Frédéric, On 03/17/2011 01:55 PM, Frédéric Dalleau wrote: --- plugins/bluetooth.c | 122 +++ plugins/bluetooth.h |7 +++ 2 files changed, 129 insertions(+), 0 deletions(-) So before you run too far with this I suggest you speak to Marcel and Johan on whether handling SCO audio inside oFono is a good idea. Personally I'd rather see this piece remain inside BlueZ, but I'm no longer an expert in this area. Regards, -Denis ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH v2 0/8] sms: Cancel pending message
Hi Lucas, On 02/04/2011 01:40 PM, Lucas De Marchi wrote: In this version I fixed some issues pointed out by Andrzej and added another patch, not so related, but that would conflict with these ones if applied to current master branch. Difference from previous version: Tested with phonesim, slightly changing its plugin in oFono in order to hold messages for a certain period. I applied this series and slightly changed the API in the process. Thanks for doing this. Can you have a quick look to make sure I didn't screw anything up? Regards, -Denis ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH] voicecall: allow pause to be sent through SendTones()
manager_tone() converts all tone chars to uppercase. Since everywhere we check for both 'p' and 'P' for a pause, tone_queue() should also check both before claiming the string is invalid. --- src/voicecall.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/voicecall.c b/src/voicecall.c index cb5258d..4932ffa 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -287,8 +287,9 @@ static int tone_queue(struct ofono_voicecall *vc, const char *tone_str, */ for (i = 0; tone_str[i]; i++) if (!g_ascii_isdigit(tone_str[i]) tone_str[i] != 'p' - tone_str[i] != '*' tone_str[i] != '#' - (tone_str[i] 'A' || tone_str[i] 'D')) + tone_str[i] != 'P' tone_str[i] != '*' + tone_str[i] != '#' (tone_str[i] 'A' || + tone_str[i] 'D')) return -EINVAL; while ((entry = g_queue_peek_nth(vc-toneq, n++)) != NULL) -- 1.7.4.1 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono