What's a "block"?

The documentation for the Data Events Handler talks about “blocks” of data.

What constitutes a “block” in this context?

ie, how does the flow determine when a “block” has started, and when it is complete?

If the end of a “block” is marked by characters (such as CR and/or LF), are those characters included in the data passed to the handler?

Hi awneil,
Sorry for the delayed reply.
The block that is received by FCM is nothing but the data that is received over the FCM flow. For instance, if you have subscribed to FCM flow for V24 and have switched the flow to data mode, then whatever your external application (eg. hyperterminal) sends to the module in one go constitutes one block.

When the external application sends something to the module, that is received in the UART FIFO buffers. This leads to the generation of an interrupt. Now, when the task which has the responsibility of reading UART, reads these FIFO buffers, it will pack the data recevied from the UART in one block and will send this to the Open-AT application for further processing.

So, there is nothing like start and ending delimiter for the block. The Open-AT application will receive an indication of the amount of data that is received along with the pointer to the received block. This can be used by Open-AT application to read the received data. When the data handler function returns TRUE, it indicates that the Open-AT application has successfully treated the received data (block) and the OS releases the memory which was reserved for the block (i.e. received chunk of data).

I hope this answers to your queries.

Best Regards,
Open AT Fan.

Thanks for the info

So, what’s “in one go” in this context?

Is there a defined inter-character gap time?

Or does it just depend on how busy the processor is?

Hi awneil,
There is no inter character gap time. It solely depends upon how busy your processor is.
For instance, you subscribe to FCM and switch it to data mode. Now from your external application, you typed a character (let’s say ‘a’). At this point of time, suppose the data is read (by the task which has to read the data received from V24). Hence, the data block in this case is the single character ‘a’.

Consider another scenario. You have copied a large amount of data onto the clipboard (using Ctrl+C keys) and now you paste that data in the hyperterminal window. When this data is pasted, it will go to the module.
Suppose, 16 bytes reached the module (because, usually the FIFO buffers on the PC side have 16 bytes). The task for reading the data from V24 will now read the data and will send it to Open-AT application. In this case, these 16 bytes will consititute one block.
The remaining data will again be received by the module (probably in a chunk of 16 bytes) and will again be sent to your OAT application as one block.

I hope this makes things clear.
Best Regards,
Open AT Fan.

Yes, that clarifies it.

I only wish the Wavecom document would’ve been clear in the first place! :angry:

Seems I’m not the only one - this is a very frequently-asked question: