Alessandro Coppelli wrote:
>
> Sorry for my ignorance but I do not know I do communication between
>
> rt task and user process using exellent mbuff driver : ( I'm sorry
> Tomasz )
> I want read and write a lot of char ( 8000-12000 ) between rt task and
> user
> process. My simple and wrong program is this :
>
static char *addr;
> void *thread_code(void *t)
> {
>
> while (1) {
> int ret;
> ret = pthread_wait_np();
>
> //Can I read data from here ? and How
> //sscanf(memname,"%s",stringa);
>
> rtl_printf("I read = %s",stringa);
// be sure that there is a string there.
rtl_printk("I read = %s\n", addr);
> }
> return 0;
> }
>
> int init_module(void)
> {
> pthread_attr_t attr;
> struct sched_param sched_param;
> int ret;
char c2;
>
> pthread_attr_init (&attr);
> sched_param.sched_priority = 1;
> pthread_attr_setschedparam (&attr, &sched_param);
> ret=pthread_create (&taskA, &attr, thread_code, (void *)1);
> pthread_make_periodic_np(pthread_self(), gethrtime(), 2000000000);
> shm_allocate(memname, memsize, &addr);
size = shm_allocate(memname, memsize, &addr)
>
> // Must I read data from here ? I have to read a lot of data from user
> process
> // it are 8000 char to LPT1
// you can now read by dereferencing the addr pointer
// e.g to get the second byte:
c2 = addr[1];
>
> return 0;
> }
Regards, Stuart
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/