Events synchronization


#1

HI,
1.I am reading gps data from uart2, and trying to send it through HTTP. I am unable to synchronize the events(please comment on synchronization of the events. Can the occurrence of the events be scheduled according to our wish?).

2.I am using same memory buffer for storing gps data and using the same for sending to server via http protocol.So, for every time i send data to server , iam unsubscribing fcm(for uart2).( is there any other method to stop reading data from uart2 till i send data and later fetch it).

const adl_InitTasks_t adl_InitTasks [] =
{
     {cfg_gprs,4096,"configuring GPRS",2},
    { uart_startup,4096,"uart_startup",1},
    { NULL, 0, NULL, 0 }
};

This is my startup table ,in first line iam configuring gprs, also the control ends up with configuring http connection channel and data channel.

In second line i am configuring uart2 .

Please comment , Thanks in advance.


#2

What events, precisely?

Why??

I would suggest a [b]circular buffer /b - the UART to puts the data into the buffer; HTTP takes the data out of the buffer.


#3

like i want to have a wip write event immediately after uart2 writes data in buffer. And if the buffer is empty i want wip write to wait till the uart fills data in buffer. In short synchronisation between wip write and uart read.

i suppose uart overwrites the unread data of http (wip write).so by unsubscribing i won’t read the data gushing in from uart.


#4

I think you have fundamentally misunderstood the Open-AT events!

WIP Events are generated by WIP in response to things happening in WIP;
WIP neither knows nor cares about the UART.

UART Events are generated by the UART in response to things happening on the UART;
The UART neither knows not cares about WIP.

In your case, you will probably respond to UART events by initiating WIP actions; the resulting WIP Events will then indicate how WIP is progressing.

And if the buffer is empty i want wip write to wait till the uart fills data in buffer. In short synchronisation between wip write and uart read.

That would be the purpose of having a circular buffer!

If you unsibscrIbe the UART, you will lose data without knowing it; if you remain subscribed, you can at least intelligently handle the overrun!

Is there any particular reason why you’re using the direct UART access rather than FCM?

Certainly with FCM, you wouldn’t need multitasking to do this as all!