Linux modules, drivers etc

This is a discussion on Linux modules, drivers etc within the Linux Programming forums, part of the Platform Specific Boards category; Dear Users, I'm currently on a monitoringproject, where I work with a linux monitor box. I monitor several RS-232 devices ...

  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    52

    Linux modules, drivers etc

    Dear Users,

    I'm currently on a monitoringproject, where I work with a linux monitor box. I monitor several RS-232 devices and everything is going really well. The problem is: how can I make my monitordata available for new applications?

    I made monitoringsoftwaredrivers and a memory management. This is a separate task. There is a service layer (2nd task) which function must be available for other applications. It takes information out of the memory management and answer this to the application. This way they never have to wait for the RS-232 protocol(which is really slow), And I can just give the API and binary to the high-level developers.

    What I want now is:
    The RS-232 service starts working on start up(this is not that hard, init.d etc.). When I start a monitor / log / smart thingy application it takes the information from my service. This application(s) will be typically written in Python.

    What is the most common / best way to do this? Module? Linked Library, Pipelines?

    Kind regards,

    Libpgeak
    Last edited by Libpgeak; 03-20-2013 at 07:46 AM.

  2. #2
    Registered User
    Join Date
    Aug 2003
    Posts
    1,197
    Look into unix sockets (AF_UNIX) and/or DBus.

  3. #3
    Registered User
    Join Date
    Sep 2011
    Posts
    52
    Thanks for you reply. But i don't search solutions(I already found a several as you can read). What are the big advantages and disadvantages of each methode?
    Currently Pipes seems in combination with Posix read() & write() seems like a decent solution.

    Kind regards,

    Libpgeak

  4. #4
    Registered User
    Join Date
    Aug 2003
    Posts
    1,197
    Well you have to consider how many "clients" you will have. With pipes I am almost certain you are limited to one client per pipe. That is if you want two clients to receiver the same information the server would have to write the same information to two pipes. The obvious obstacle then is; how does the RS232 service keep track of which pipes it should write to (probably involving scanning a directory for all named pipes and sending the same information to all those pipes, opening and closing them all and whatnot).

    If you only ever plan to have a single client then named pipes are probably the easiest way to get going, just let the service create the pipe and let the client open the pipe. Remember that pipes are one direction only, you need to have 2 pipes in order to talk both ways. If you want to have multiple clients you will most likely find sockets to be the easiest way forward. Sockets are two-way by design aswell.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linux Security Modules Programming
    By vugluskr in forum Linux Programming
    Replies: 1
    Last Post: 02-17-2009, 10:10 AM
  2. ATI Linux display drivers
    By psychopath in forum Tech Board
    Replies: 2
    Last Post: 03-23-2006, 11:35 AM
  3. Linux drivers. (can't find any)
    By psychopath in forum Tech Board
    Replies: 3
    Last Post: 03-08-2005, 02:29 PM
  4. Linux Device Drivers
    By WebmasterMattD in forum Linux Programming
    Replies: 2
    Last Post: 05-07-2002, 09:06 PM
  5. Writing Linux Drivers
    By Jperensky in forum Linux Programming
    Replies: 1
    Last Post: 03-20-2002, 08:30 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21