# Photon UDP function return values

**URL:** <https://community.particle.io/t/photon-udp-function-return-values/13848>\
**Category:** Firmware\
**Created:** [July 27, 2015, 4:43pm UTC](https://community.particle.io/t/photon-udp-function-return-values/13848 "2015-07-27T16:43:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jakeypoo](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@jakeypoo](https://community.particle.io/u/jakeypoo)\
**Post date:** [July 27, 2015, 4:43pm UTC](https://community.particle.io/t/photon-udp-function-return-values/13848/1 "2015-07-27T16:43:41Z")

</div>

When building with 0.4.3 for photon :

`UDP.begin( port )` always returns 0 .  
Previously, the core firmware returns an indication whether the port was opened ( return \> 0 ) or failed to open ( return \< 1 )  
The returned value in `spark_wiring_udp.cpp` ( `bound` ) is initiated as 0 but never updated.

`UDP.write()` returns 0 on success, previously it would return the number of bytes sent. It returns an error value ( \< 0 ) if the write fails.

Can we get an update about when these will be have the correct return values implemented?  
(Or on when the `UDP.endPacket()` behaviour will be implemented for photon?)

Thanks.

EDIT: Added that the udp.write error return values

---

<div class="post-metadata">

**Author:** ![jakeypoo](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@jakeypoo](https://community.particle.io/u/jakeypoo)\
**Post date:** [July 27, 2015, 6:53pm UTC](https://community.particle.io/t/photon-udp-function-return-values/13848/2 "2015-07-27T18:53:37Z")

</div>

Also, semi-related: UDPparsePacket() now successfully parses one datagram at a time on the photon. 😄

---

<div class="post-metadata">

**Author:** ![mdma](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mdma/32/1924_2.png) [@mdma](https://community.particle.io/u/mdma)\
**Post date:** [August 20, 2015, 5:00am UTC](https://community.particle.io/t/photon-udp-function-return-values/13848/3 "2015-08-20T05:00:30Z")

</div>

Here’s an issue to track this. I hope to implement it in the next release. (0.4.5)

> <https://github.com/particle-iot/firmware/issues/552>
