×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Regular Contributor
    Join Date
    Jul 2007
    Posts
    51

    raccoon starts a Symbian application

    Hello,

    I want the server raccoon starts a Symbian application when receives a HTTP request, is possible?

    Thank you!

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: raccoon starts a Symbian application

    Quote Originally Posted by jmv_ View Post
    I want the server raccoon starts a Symbian application when receives a HTTP request, is possible?
    Sure you can.

    Using Python you should (should, because I havn't tried it) be able to start another application using e32.start_exe(). From a native Apache module it can definitely be done.

    However, if you want to use that other application in a CGI kind of way, so that the external application generates HTML and the communication is handled by reading/writing from/to stdout/stdin, some modifications might be needed.

    Johan

  3. #3
    Regular Contributor
    Join Date
    Jul 2007
    Posts
    51

    Re: raccoon starts a Symbian application

    Hi!

    Which is the easier form to do it? is some example available?
    I don´t know how to begin...

    Thanks!

  4. #4
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: raccoon starts a Symbian application

    Quote Originally Posted by jmv_ View Post
    Which is the easier form to do it? is some example available?
    I don´t know how to begin...
    Why don't you start by telling what you want to accomplish

    That might make it easier to say where to begin.

    Johan

  5. #5
    Regular Contributor
    Join Date
    Jul 2007
    Posts
    51

    Re: raccoon starts a Symbian application

    ok, the idea is:

    I have a Symbian application that sends SMS to some contacts registered in a file, then I want the server, raccoon, starts this application when recives a HTTP request.

    Thanks!

  6. #6
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: raccoon starts a Symbian application

    Quote Originally Posted by jmv_ View Post
    I have a Symbian application that sends SMS to some contacts registered in a file, then I want the server, raccoon, starts this application when recives a HTTP request.
    Do you have the source-code of that application? In that case, the best approach is probably to factor out the functionality you are interested in, and then create a custom Apache module that does exactly what you want.

    What kind of application is it? Does it have a GUI?

    Johan

  7. #7
    Regular Contributor
    Join Date
    Jul 2007
    Posts
    51

    Re: raccoon starts a Symbian application

    It's a "console" application.
    I have done it thinking about that it worked in background.

    Thanks!

  8. #8
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: raccoon starts a Symbian application

    Quote Originally Posted by jmv_ View Post
    It's a "console" application.
    I have done it thinking about that it worked in background.
    In that case you have alternatives; the program can run all the time as a server that the Apache request handler contacts using some IPC mechanism, or then you can invoke the program as the result of a HTTP request.

    I assume you are using OpenC? Check 'Open C Documentation' -> 'Developer Guides' -> 'Threads,Processes,IPC, and Synchronization' for documentation on what kind of IPC mechanisms you have available. And check out posix_spawn for how to start an executable.

    Johan

  9. #9
    Regular Contributor
    Join Date
    Jul 2007
    Posts
    51

    Re: raccoon starts a Symbian application

    Hi!
    I have been reading the documentation but I do not know how beginning the code… You know if there is some similar example that can serve me to begin?

    Thanks again!

  10. #10
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: raccoon starts a Symbian application

    Quote Originally Posted by jmv_ View Post
    I have been reading the documentation but I do not know how beginning the code… You know if there is some similar example that can serve me to begin?
    I'm sorry, I don't have any ready example available.

    Johan

  11. #11
    Registered User
    Join Date
    May 2007
    Posts
    3

    Re: raccoon starts a Symbian application

    Hi!
    The function:
    int posix_spawn(pid_t * pid, const char * path,
    const posix_spawn_file_actions_t *file_actions,
    const posix_spawnattr_t * attrp,
    char *const argv[], char *const envp[]);

    The argument "const char * path", what kind of file can execute? a .sis file, a .exe file,...? I would like execute a "console" application, but I don´t know how to install it in my phone, I use Carbide and I don´t have a .sis of my application, only a .exe that I can run in the emulator when I do double click.

    Thank you!

  12. #12
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: raccoon starts a Symbian application

    Quote Originally Posted by jmanzano View Post
    The argument "const char * path", what kind of file can execute? a .sis file, a .exe file,...?
    An executable file, but remember that on S60v3.0 you can only execute files that reside in the directory c:\sys\bin
    I would like execute a "console" application, but I don´t know how to install it in my phone, I use Carbide and I don´t have a .sis of my application, only a .exe that I can run in the emulator when I do double click.
    You have to create a SIS-file, because only the installer can put a file to c:\sys\bin. Check from the documentation and the examples included with the S60 SDK how to do that.

    Johan

  13. #13
    Regular Contributor
    Join Date
    Jul 2007
    Posts
    51

    Re: raccoon starts a Symbian application

    Hi!
    I tested the function posix_spawn to see if it can run an console application (SendSMS). I created a new project in Carbide, it creates a default console application: Hello World!.

    The code is:

    // Include Files

    #include "StartApp.h"
    #include <e32base.h>
    #include <e32std.h>
    #include <e32cons.h> // Console
    #include <spawn.h>

    // Constants

    _LIT(KTextConsoleTitle, "Console");
    _LIT(KTextFailed, " failed, leave code = %d");
    _LIT(KTextPressAnyKey, " [press any key]\n");


    // Global Variables

    LOCAL_D CConsoleBase* console; // write all messages to this


    // Local Functions

    LOCAL_C void MainL()
    {
    //
    // add your program code here, example code below
    //
    console->Write(_L("Hello, world!\n"));
    pid_t* pid;
    const char* path="..\\..\\Epoc32\\release\\winscw\\udeb\\SendSMS";
    const posix_spawn_file_actions_t* file_actions=NULL;
    const posix_spawnattr_t* attrp= NULL;
    int result = posix_spawn(pid, path, file_actions, attrp, NULL, NULL);

    }
    ....
    ....

    That path is where I have the executable of the application I want to start, that is if I do double click it running on the emulator. But I do not think that it is ok ...

    Additionally, the application does not compile, the error is:
    Undefinied symbol: '_posix_spawn' referenced from 'void mainL(void) (?MainL@@YAXXZ)' in StartApp.cpp:45
    Where I invoke the function posix_spawn.

    Thanks again!

  14. #14
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: raccoon starts a Symbian application

    Quote Originally Posted by jmv_ View Post
    That path is where I have the executable of the application I want to start, that is if I do double click it running on the emulator. But I do not think that it is ok ...
    Probably not - just use SendSMS.exe. That should do the right thing on the emulator and on target.

    Additionally, the application does not compile, the error is:
    Undefinied symbol: '_posix_spawn' referenced from 'void mainL(void) (?MainL@@YAXXZ)' in StartApp.cpp:45
    Where I invoke the function posix_spawn.
    Have you added the library libc.lib?

    Johan

  15. #15
    Regular Contributor
    Join Date
    Jul 2007
    Posts
    51

    Re: raccoon starts a Symbian application

    Hi!

    I have solved the problem of compilation, it was by the library libc.lib. However, the application does something rare:
    - Displays Hello World! If you do not write the function posix_spawn but if I write the function does not show Hello World! and it does nothing in the emulator.
    - I believe that the parameters of the function posix_spawn are not properly (I think the path) but anyway it should print Hello World! because the code is before the function posix_spawn...

    LOCAL_C void MainL()
    {
    //
    // add your program code here, example code below
    //
    console->Write(_L("Hello, world!\n"));

    pid_t pid;
    const char* path = "..\\..\\epoc32\\release\\winscw\\udeb\\SendSMS.exe";
    posix_spawn(&pid, path, NULL, NULL, NULL ,NULL);
    }

    The file SendSMS.exe that I want the function started is in this path, here is where Carbide save it to try it in the emulator ...
    I searched on the Internet but did not find examples of the use of the function posix_spawn in Symbian ...
    I don't know what can I do...

    Thanks!!

Similar Threads

  1. symbian signed testing problem.
    By anglina in forum Symbian
    Replies: 0
    Last Post: 2007-02-01, 10:15
  2. Replies: 0
    Last Post: 2007-01-25, 07:51
  3. memory issue on 3rd edition symbian application
    By deepti.panwar in forum General Development Questions
    Replies: 4
    Last Post: 2006-12-08, 11:36
  4. Replies: 6
    Last Post: 2005-10-14, 10:44
  5. DB2E Application Installation Fail in Symbian 7 Emulator
    By darontan in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2005-03-03, 01:51

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×