# WIP : WIP\_CEV\_READ and WIP\_CEV\_WRITE

**URL:** <https://forum.sierrawireless.com/t/wip-wip-cev-read-and-wip-cev-write/832>\
**Category:** Open AT\
**Created:** [November 3, 2006, 2:08pm UTC](https://forum.sierrawireless.com/t/wip-wip-cev-read-and-wip-cev-write/832 "2006-11-03T14:08:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gdt](https://avatars.discourse-cdn.com/v4/letter/g/7993a0/32.png) [@gdt](https://forum.sierrawireless.com/u/gdt)\
**Post date:** [November 3, 2006, 2:08pm UTC](https://forum.sierrawireless.com/t/wip-wip-cev-read-and-wip-cev-write/832/1 "2006-11-03T14:08:30Z")

</div>

Hi everyone,

I use the Wip on the new openat 4.1 with a Q2686H.  
I connect to a socket with

```auto
gprsWipChannel = wip_TCPClientCreateOpts((const ascii*) gprsFlashRegistry->SocketHost, gprsFlashRegistry->SocketPort, gprs_SocketHandler, NULL, 
											WIP_COPT_SND_BUFSIZE, 536,
											WIP_COPT_MAXSEG, 536,
											WIP_COPT_NODELAY, 1,
											WIP_COPT_SND_LOWAT, 1,
											WIP_COPT_RCV_LOWAT, 1,
											WIP_COPT_END);
```

and the events WIP\_CEV\_WRITE are not fired when there is 1 byte free in the buffer (for test purpose). WIP\_CEV\_READ are not fired when 1 byte is received…I don’t understand why…

thank you in advance

Best regards,

gdt

---

<div class="post-metadata">

**Author:** ![tomalex](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@tomalex](https://forum.sierrawireless.com/u/tomalex)\
**Post date:** [November 5, 2006, 11:38am UTC](https://forum.sierrawireless.com/t/wip-wip-cev-read-and-wip-cev-write/832/2 "2006-11-05T11:38:44Z")

</div>

Hello gdt,

WIP\_CEV\_READ and WIP\_CEV\_WRITE will fire if you open the socket and data arrives first time.  
The other scenario, when you read or write more data than the socket can handle at that moment.

For example, in your incoming data processing routine when you receive the WIP\_CEV\_READ (first time you will) after you have red all available bytes just read additional byte(s) with wip\_read() function. The WIP\_CEV\_READ event will come again when data arrives. In case of write, if the wip\_write() function returns less value than the buffer length you provided, the WIP\_CEV\_WRITE will fire when you can send more data.

Best Regards,

tom

---

<div class="post-metadata">

**Author:** ![gdt](https://avatars.discourse-cdn.com/v4/letter/g/7993a0/32.png) [@gdt](https://forum.sierrawireless.com/u/gdt)\
**Post date:** [November 10, 2006, 10:38am UTC](https://forum.sierrawireless.com/t/wip-wip-cev-read-and-wip-cev-write/832/3 "2006-11-10T10:38:00Z")

</div>

Hi tom,

For the WIP\_CEV\_READ event, I don’t press enter in netcat, so the data where not send…I receive the event when it is correct.

For the WIP\_CEV\_WRITE event, I configured the wip\_TCPClientCreateOpts with WIP\_COPT\_SND\_LOWAT, 1 so according to the documentation, I must receive a WIP\_CEV\_WRITE event each 1 new byte free in the send buffer.

I receive this event only once at the connection to the socket…

If I want to know how much bytes are free in the buffer, I make polling on the WIP\_COPT\_NWRITE parameter with wip\_getOpts.

Thanks in advance

Best regards,

gdt

---

<div class="post-metadata">

**Author:** ![gdt](https://avatars.discourse-cdn.com/v4/letter/g/7993a0/32.png) [@gdt](https://forum.sierrawireless.com/u/gdt)\
**Post date:** [November 17, 2006, 10:23am UTC](https://forum.sierrawireless.com/t/wip-wip-cev-read-and-wip-cev-write/832/4 "2006-11-17T10:23:02Z")

</div>

"In case of write, if the wip\_write() function returns less value than the buffer length you provided, the WIP\_CEV\_WRITE will fire when you can send more data. " It’s normal that I not receive this event because I send never more data at one time that the wip can handle… I do that like i did it when I used edlib… hmmm some philosophic choices 😉

Thank you for explanations

Best regards,

gdt
