* [PATCH 1/1] gatserver: Add send raw data function
@ 2011-02-11 16:03 Olivier Guiter
2011-02-14 16:23 ` Denis Kenzior
0 siblings, 1 reply; 3+ messages in thread
From: Olivier Guiter @ 2011-02-11 16:03 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1300 bytes --]
---
gatchat/gatserver.c | 14 ++++++++++++++
gatchat/gatserver.h | 1 +
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c
index 25b7ba4..f2ee34d 100644
--- a/gatchat/gatserver.c
+++ b/gatchat/gatserver.c
@@ -252,6 +252,20 @@ void g_at_server_send_info(GAtServer *server, const char *line, gboolean last)
send_common(server, buf, len);
}
+void g_at_server_send_data(GAtServer *server, const char *format, ...)
+{
+ char buf[MAX_TEXT_SIZE + 1];
+ unsigned int len;
+
+ va_list ap;
+
+ va_start(ap, format);
+ len = vsnprintf(buf, MAX_TEXT_SIZE, format, ap);
+ va_end(ap);
+
+ send_common(server, buf, len);
+}
+
static gboolean get_result_value(GAtServer *server, GAtResult *result,
const char *command,
int min, int max, int *value)
diff --git a/gatchat/gatserver.h b/gatchat/gatserver.h
index f0c19da..911f20d 100644
--- a/gatchat/gatserver.h
+++ b/gatchat/gatserver.h
@@ -112,6 +112,7 @@ void g_at_server_send_unsolicited(GAtServer *server, const char *result);
* responses.
*/
void g_at_server_send_info(GAtServer *server, const char *line, gboolean last);
+void g_at_server_send_data(GAtServer *server, const char *format, ...);
#ifdef __cplusplus
}
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH 1/1] gatserver: Add send raw data function
2011-02-11 16:03 [PATCH 1/1] gatserver: Add send raw data function Olivier Guiter
@ 2011-02-14 16:23 ` Denis Kenzior
2011-02-14 16:32 ` Olivier Guiter
0 siblings, 1 reply; 3+ messages in thread
From: Denis Kenzior @ 2011-02-14 16:23 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 418 bytes --]
Hi Olivier,
> @@ -112,6 +112,7 @@ void g_at_server_send_unsolicited(GAtServer *server, const char *result);
> * responses.
> */
> void g_at_server_send_info(GAtServer *server, const char *line, gboolean last);
> +void g_at_server_send_data(GAtServer *server, const char *format, ...);
>
What is the target use case you're thinking of for this one?
> #ifdef __cplusplus
> }
Regards,
-Denis
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] gatserver: Add send raw data function
2011-02-14 16:23 ` Denis Kenzior
@ 2011-02-14 16:32 ` Olivier Guiter
0 siblings, 0 replies; 3+ messages in thread
From: Olivier Guiter @ 2011-02-14 16:32 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 786 bytes --]
Hi Denis,
The purpose was to be able to send long AT commands answers (like the
AT+CGDCONT?) without allocating buffers but, after reconsidering the
code it is not really needed as i can use the "g_at_server_send_info"
for the same purpose ;)
So you can ignore this patch.
Thanks
Olivier
On 02/14/2011 05:23 PM, Denis Kenzior wrote:
> Hi Olivier,
>
>> @@ -112,6 +112,7 @@ void g_at_server_send_unsolicited(GAtServer *server, const char *result);
>> * responses.
>> */
>> void g_at_server_send_info(GAtServer *server, const char *line, gboolean last);
>> +void g_at_server_send_data(GAtServer *server, const char *format, ...);
>>
> What is the target use case you're thinking of for this one?
>
>> #ifdef __cplusplus
>> }
> Regards,
> -Denis
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-02-14 16:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-11 16:03 [PATCH 1/1] gatserver: Add send raw data function Olivier Guiter
2011-02-14 16:23 ` Denis Kenzior
2011-02-14 16:32 ` Olivier Guiter
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.