gnokii-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] Additional programs and language bindings branch, master, updated.


From: Daniele Forsi
Subject: [SCM] Additional programs and language bindings branch, master, updated. 149f5659f31530b27f5b455a56622ebbbff39da7
Date: Sun, 12 Jan 2014 17:50:14 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Additional programs and language bindings".

The branch, master has been updated
       via  149f5659f31530b27f5b455a56622ebbbff39da7 (commit)
      from  032f622ce9285b2e043858ce6b556d463261446c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/gnokii/gnokii-extras.git/commit/?id=149f5659f31530b27f5b455a56622ebbbff39da7


commit 149f5659f31530b27f5b455a56622ebbbff39da7
Author: Daniele Forsi <address@hidden>
Date:   Sun Jan 12 18:48:09 2014 +0100

    Add misc/photo
    
    Some files were included in the previous commit by mistake.

diff --git a/snippets/ChangeLog b/snippets/ChangeLog
index 87b95eb..a5bbcc8 100644
--- a/snippets/ChangeLog
+++ b/snippets/ChangeLog
@@ -1,3 +1,7 @@
+2014/01/12
+ * misc/
+    o add photo.c                                            (Daniele Forsi)
+
 2014/01/06
  * monitor/
     o add --ignore option to waitcall.c                      (Daniele Forsi)
diff --git a/snippets/misc/.gitignore b/snippets/misc/.gitignore
index 5e0840d..4ba1084 100644
--- a/snippets/misc/.gitignore
+++ b/snippets/misc/.gitignore
@@ -1,6 +1,7 @@
 error_codes
 error_codes_intl
 events
+photo
 get_supported_phone_model
 gnokii_error
 gnokii_memory
diff --git a/snippets/misc/Makefile b/snippets/misc/Makefile
index ec898f0..fa2e1df 100644
--- a/snippets/misc/Makefile
+++ b/snippets/misc/Makefile
@@ -4,6 +4,7 @@ PROGS = \
        error_codes \
        error_codes_intl \
        events \
+       photo \
        get_supported_phone_model \
        gnokii_error \
        gnokii_memory \
diff --git a/snippets/misc/photo.c b/snippets/misc/photo.c
index 491f67b..e1f8d77 100644
--- a/snippets/misc/photo.c
+++ b/snippets/misc/photo.c
@@ -25,6 +25,7 @@
   Copyright (C) 2014 by Daniele Forsi
 
   Takes a photo with the camera built into the phone.
+  This will work ONLY with Series 40 phones (see include/phones/nk6510.h for 
key values).
 
   compile with
   gcc -Wall -o photo battery_level.c `pkg-config --libs gnokii`
@@ -73,7 +74,7 @@ void signal_handler(int signal) {
        exit(-2);
 }
 
-/* Definitions stolen from private includes */
+/* Definitions copied from private includes */
 #define FBUS_FRAME_HEADER 0x00, 0x01, 0x00
 #define NK6510_MSG_KEYPRESS 0x0c
 
@@ -81,7 +82,7 @@ int main(int argc, char *argv[]) {
        gn_data         data;
        gn_error        error;
        unsigned char req[] = {FBUS_FRAME_HEADER, 0x11, 0,
-                              2, /* number of keypresses */
+                              2, /* number of blocks */
                               1, 0x08 /* block length */, 0xe0, 0x5c, 1 /* 
press */, 0, 0, 0,
                               1, 0x08 /* block length */, 0xe0, 0x5c, 0 /* 
release */, 0, 0, 0};
        gn_raw_buffer write_buffer = {NK6510_MSG_KEYPRESS, sizeof(req), req};
@@ -102,10 +103,14 @@ int main(int argc, char *argv[]) {
        data.write_buffer = &write_buffer;
        data.read_buffer = &read_buffer;
        error = gn_sm_functions(GN_OP_Passthrough, &data, state);
+       free(read_buffer.buffer);
+       read_buffer.buffer = NULL;
        if (error == GN_ERR_NONE) {
                /* Need to wait a little before the camera app is ready */
                sleep(2);
                error = gn_sm_functions(GN_OP_Passthrough, &data, state);
+               free(read_buffer.buffer);
+               read_buffer.buffer = NULL;
                /* Now we could wait for the photo to be saved, then exit the 
camera app */
        }
 
diff --git a/snippets/misc/photo.readme b/snippets/misc/photo.readme
index 2211bed..72ba8aa 100644
--- a/snippets/misc/photo.readme
+++ b/snippets/misc/photo.readme
@@ -1,6 +1,6 @@
 $Id$
 
-Takes a photo emulating keypresses.
+Takes a photo emulating keypresses. Needs libgnokii 0.6.32 or later.
 Tested on Series 40 3rd (Nokia 5300).
 
 Example:

-----------------------------------------------------------------------

Summary of changes:
 snippets/ChangeLog         |    4 ++++
 snippets/misc/.gitignore   |    1 +
 snippets/misc/Makefile     |    1 +
 snippets/misc/photo.c      |    9 +++++++--
 snippets/misc/photo.readme |    2 +-
 5 files changed, 14 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Additional programs and language bindings



reply via email to

[Prev in Thread] Current Thread [Next in Thread]