* Adding New contact failed in Ofono
@ 2011-05-16 7:28 Yuvaraj Ragupathi
2011-05-16 2:27 ` Denis Kenzior
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Yuvaraj Ragupathi @ 2011-05-16 7:28 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 734 bytes --]
Hi All,
I am trying to add new contact in sim via following sample code
static int new_contact(struct ofono_phonebook *pb,char
*num,ofono_phonebook_cb_t cb)
{
struct pb_data *pbd = ofono_phonebook_get_data(pb);
char cmd[50];int return_value;
sprintf(cmd,"AT+CPBW=10,%s,129,Testing", num);
printf("Command is %s\n",cmd);
return_value=g_at_chat_send(pbd->chat,cmd, none_prefix,
NULL,NULL, NULL);
printf("Add New contact number in Sim\n Status is
%d\n",return_value);
return return_value;
}
If i try to add new contact my Return status is 69 or 70
what is does mean?
I verified in my Sim. Contact is not added
Thanks
Yuvi R
[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 827 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Adding New contact failed in Ofono 2011-05-16 7:28 Adding New contact failed in Ofono Yuvaraj Ragupathi @ 2011-05-16 2:27 ` Denis Kenzior 2011-05-17 5:54 ` Yuvaraj Ragupathi 2011-05-16 8:17 ` Aygon, Bertrand 2011-05-16 8:27 ` Jeevaka Prabu Badrappan 2 siblings, 1 reply; 8+ messages in thread From: Denis Kenzior @ 2011-05-16 2:27 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 1309 bytes --] Hi Yuvi, On 05/16/2011 02:28 AM, Yuvaraj Ragupathi wrote: > Hi All, > > I am trying to add new contact in sim via following sample code > > > static int new_contact(struct ofono_phonebook *pb,char > *num,ofono_phonebook_cb_t cb) > { > struct pb_data *pbd = ofono_phonebook_get_data(pb); > char cmd[50];int return_value; > sprintf(cmd,"AT+CPBW=10,%s,129,Testing", num); > printf("Command is %s\n",cmd); > return_value=g_at_chat_send(pbd->chat,cmd, none_prefix, > NULL,NULL, NULL); > printf("Add New contact number in Sim\n Status is > %d\n",return_value); > return return_value; > } > oFono core does not support adding new contacts to the sim and there are no plans to do so. So I'm not quite sure what you're trying to accomplish here in the first place. If your question is about using GAtChat, then adjust your subject accordingly. > > If i try to add new contact my Return status is 69 or 70 > Your 'return status' is just an ID assigned by GAtChat. GAtChat is _asynchronous_, your command has not been executed yet. If you want to know the result of the operation, provide a proper callback, or at the very least enable AT debug logging. See HACKING for details. Regards, -Denis ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Adding New contact failed in Ofono 2011-05-16 2:27 ` Denis Kenzior @ 2011-05-17 5:54 ` Yuvaraj Ragupathi 2011-05-17 6:33 ` Marcel Holtmann 0 siblings, 1 reply; 8+ messages in thread From: Yuvaraj Ragupathi @ 2011-05-17 5:54 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 1832 bytes --] Hi, Thanks for your reply. Suppose end user wants to store his/her contact number in SIM. What is the way to do? Actually all mobile devices supporting these features. ( Personally i feel that very end user expecting these feature). I don't know ,there could some technical reasons Please correct me. If my understanding is wrong Thanks Yuvi R On Mon, May 16, 2011 at 7:57 AM, Denis Kenzior <denkenz@gmail.com> wrote: > Hi Yuvi, > > On 05/16/2011 02:28 AM, Yuvaraj Ragupathi wrote: > > Hi All, > > > > I am trying to add new contact in sim via following sample code > > > > > > static int new_contact(struct ofono_phonebook *pb,char > > *num,ofono_phonebook_cb_t cb) > > { > > struct pb_data *pbd = ofono_phonebook_get_data(pb); > > char cmd[50];int return_value; > > sprintf(cmd,"AT+CPBW=10,%s,129,Testing", num); > > printf("Command is %s\n",cmd); > > return_value=g_at_chat_send(pbd->chat,cmd, none_prefix, > > NULL,NULL, NULL); > > printf("Add New contact number in Sim\n Status is > > %d\n",return_value); > > return return_value; > > } > > > > oFono core does not support adding new contacts to the sim and there are > no plans to do so. So I'm not quite sure what you're trying to > accomplish here in the first place. If your question is about using > GAtChat, then adjust your subject accordingly. > > > > > If i try to add new contact my Return status is 69 or 70 > > > > Your 'return status' is just an ID assigned by GAtChat. GAtChat is > _asynchronous_, your command has not been executed yet. If you want to > know the result of the operation, provide a proper callback, or at the > very least enable AT debug logging. See HACKING for details. > > Regards, > -Denis > [-- Attachment #2: attachment.html --] [-- Type: text/html, Size: 2349 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Adding New contact failed in Ofono 2011-05-17 5:54 ` Yuvaraj Ragupathi @ 2011-05-17 6:33 ` Marcel Holtmann 0 siblings, 0 replies; 8+ messages in thread From: Marcel Holtmann @ 2011-05-17 6:33 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 1083 bytes --] Hi Yuvi, please respect the mailing etiquette and do not top post. > Suppose end user wants to store his/her contact number in SIM. What is the > way to do? > > Actually all mobile devices supporting these features. ( Personally i feel > that very end user expecting these feature). This is actually not true. Neither the iPhone nor Android devices are supporting writing to the SIM card. They only support importing contacts from the SIM card for legacy reasons. And oFono does support exactly the same. The Android Nexus S export functionality for example is only USB and sharing your contacts over Bluetooth or via email. No exporting to SIM card is supported. > I don't know ,there could some technical reasons The SIM phonebook is too limited in the number of field or number of entries to be anywhere near useful for anybody. It is not a storage location that should be used anymore. It is ancient and outdated. And for the same reason we do not support storing SMS on the SIM card and import existing ones if found. Regards Marcel ^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: Adding New contact failed in Ofono 2011-05-16 7:28 Adding New contact failed in Ofono Yuvaraj Ragupathi 2011-05-16 2:27 ` Denis Kenzior @ 2011-05-16 8:17 ` Aygon, Bertrand 2011-05-16 8:27 ` Jeevaka Prabu Badrappan 2 siblings, 0 replies; 8+ messages in thread From: Aygon, Bertrand @ 2011-05-16 8:17 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 1508 bytes --] Hi, >Hi All, > >I am trying to add new contact in sim via following sample code > > >static int new_contact(struct ofono_phonebook *pb,char *num,ofono_phonebook_cb_t cb) >{ > struct pb_data *pbd = ofono_phonebook_get_data(pb); > char cmd[50];int return_value; > sprintf(cmd,"AT+CPBW=10,%s,129,Testing", num); > printf("Command is %s\n",cmd); > return_value=g_at_chat_send(pbd->chat,cmd, none_prefix, > NULL,NULL, NULL); > printf("Add New contact number in Sim\n Status is %d\n",return_value); > return return_value; >} > > >If i try to add new contact my Return status is 69 or 70 > > >what is does mean? > >I verified in my Sim. Contact is not added Do you have the AT log? One thing I have in mind, is that phone number and name must be a quoted string: sprintf(cmd,"AT+CPBW=10,\"%s\",129,\"Testing\"", num); Regards, Bertrand --------------------------------------------------------------------- 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. [-- Attachment #2: attachment.html --] [-- Type: text/html, Size: 5414 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Adding New contact failed in Ofono 2011-05-16 7:28 Adding New contact failed in Ofono Yuvaraj Ragupathi 2011-05-16 2:27 ` Denis Kenzior 2011-05-16 8:17 ` Aygon, Bertrand @ 2011-05-16 8:27 ` Jeevaka Prabu Badrappan 2011-05-16 8:58 ` Yuvaraj Ragupathi 2 siblings, 1 reply; 8+ messages in thread From: Jeevaka Prabu Badrappan @ 2011-05-16 8:27 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 1323 bytes --] Hi Yuvi, > On Mon, May 16, 2011 at 10:28 AM, Yuvaraj Ragupathi <yuvaraj.addu@gmail.com> wrote: > Hi All, > > I am trying to add new contact in sim via following sample code > > > static int new_contact(struct ofono_phonebook *pb,char *num,ofono_phonebook_cb_t cb) > { > struct pb_data *pbd = ofono_phonebook_get_data(pb); > char cmd[50];int return_value; > sprintf(cmd,"AT+CPBW=10,%s,129,Testing", num); > printf("Command is %s\n",cmd); > return_value=g_at_chat_send(pbd->chat,cmd, none_prefix, > NULL,NULL, NULL); > printf("Add New contact number in Sim\n Status is %d\n",return_value); > return return_value; > } > I don't think there is any plan to support storing contacts to SIM storage in the ofono core. Can be confirmed by the Denis/Marcel. As per the 27.007 spec, +CPBW=[<index>][,<number>[,<type>[,<text>[,<group>[,<adnumber>[,<adtype>[,<secondtext>[,<email>[,<sip_uri>[,<tel_uri>[,<hidden>]]]]]]]]]]] Possible response(s) +CPBW: <written index> +CME ERROR: <err> Atleast as per the code, I notice that you are using none_prefix which is not correct. Also you haven't given any callback function to handle the result. Regards, Jeevaka ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Adding New contact failed in Ofono 2011-05-16 8:27 ` Jeevaka Prabu Badrappan @ 2011-05-16 8:58 ` Yuvaraj Ragupathi 2011-05-16 9:02 ` Aygon, Bertrand 0 siblings, 1 reply; 8+ messages in thread From: Yuvaraj Ragupathi @ 2011-05-16 8:58 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 2722 bytes --] Hi, I am doing this work for ST Ericsson modem. Now i registered callback function for result handling and added quotes in cmd. Now cmd is AT+CPBW=10,"123456789",129,"Testing" *Log message:* Control @ Command is AT+CPBW=10,"123456789",129,"Testing" Add New contact number in Sim Status is 69 Saving contact on Sim is failed *Code :* static const char *cpbw_prefix[] = { "+CPBW:", NULL }; static void myResult(gboolean ok, GAtResult *result, gpointer user_data) { struct cb_data *cbd = user_data; if(!ok) printf(" Saving contact on Sim is failed\n"); } static int new_contact(struct ofono_phonebook *pb,char *num,ofono_phonebook_cb_t cb) { struct pb_data *pbd = ofono_phonebook_get_data(pb); char cmd[50];int return_value; sprintf(cmd,"AT+CPBW=10,\"%s\",129,\"Testing\"", num); printf("Command is %s\n",cmd); return_value=g_at_chat_send(pbd->chat,cmd, cpbw_prefix, myResult,NULL, NULL); printf("Add New contact number in Sim\n Status is %d\n",return_value); return return_value; } Thanks Yuvi R On Mon, May 16, 2011 at 1:57 PM, Jeevaka Prabu Badrappan < jeevakaprabu@gmail.com> wrote: > Hi Yuvi, > > > On Mon, May 16, 2011 at 10:28 AM, Yuvaraj Ragupathi < > yuvaraj.addu(a)gmail.com> wrote: > > Hi All, > > > > I am trying to add new contact in sim via following sample code > > > > > > static int new_contact(struct ofono_phonebook *pb,char > *num,ofono_phonebook_cb_t cb) > > { > > struct pb_data *pbd = ofono_phonebook_get_data(pb); > > char cmd[50];int return_value; > > sprintf(cmd,"AT+CPBW=10,%s,129,Testing", num); > > printf("Command is %s\n",cmd); > > return_value=g_at_chat_send(pbd->chat,cmd, none_prefix, > > NULL,NULL, NULL); > > printf("Add New contact number in Sim\n Status is > %d\n",return_value); > > return return_value; > > } > > > > I don't think there is any plan to support storing contacts to SIM > storage in the ofono core. Can be confirmed by > the Denis/Marcel. > > As per the 27.007 spec, > > > +CPBW=[<index>][,<number>[,<type>[,<text>[,<group>[,<adnumber>[,<adtype>[,<secondtext>[,<email>[,<sip_uri>[,<tel_uri>[,<hidden>]]]]]]]]]]] > > Possible response(s) > > +CPBW: <written index> > > +CME ERROR: <err> > > Atleast as per the code, I notice that you are using none_prefix which > is not correct. Also you haven't given any callback function to handle > the result. > > Regards, > Jeevaka > _______________________________________________ > ofono mailing list > ofono(a)ofono.org > http://lists.ofono.org/listinfo/ofono > [-- Attachment #2: attachment.html --] [-- Type: text/html, Size: 3585 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: Adding New contact failed in Ofono 2011-05-16 8:58 ` Yuvaraj Ragupathi @ 2011-05-16 9:02 ` Aygon, Bertrand 0 siblings, 0 replies; 8+ messages in thread From: Aygon, Bertrand @ 2011-05-16 9:02 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 1176 bytes --] Hi, >I am doing this work for ST Ericsson modem. > >Now i registered callback function for result handling and added quotes in cmd. Now cmd is > >AT+CPBW=10,"123456789",129,"Testing" > >Log message: > >Control @ Command is AT+CPBW=10,"123456789",129,"Testing" >Add New contact number in Sim > Status is 69 > Saving contact on Sim is failed Please do not top-post on the mailing list. Can you please provide AT log (export OFONO_AT_DEBUG=1)? Did you also select the appropriate phonebook storage because writing, and make sure that the phonebook is 'ready'? Regards, Bertrand. --------------------------------------------------------------------- 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. [-- Attachment #2: attachment.html --] [-- Type: text/html, Size: 4586 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-05-17 6:33 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-05-16 7:28 Adding New contact failed in Ofono Yuvaraj Ragupathi 2011-05-16 2:27 ` Denis Kenzior 2011-05-17 5:54 ` Yuvaraj Ragupathi 2011-05-17 6:33 ` Marcel Holtmann 2011-05-16 8:17 ` Aygon, Bertrand 2011-05-16 8:27 ` Jeevaka Prabu Badrappan 2011-05-16 8:58 ` Yuvaraj Ragupathi 2011-05-16 9:02 ` Aygon, Bertrand
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.