This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

UDP connection based on CMSIS library

Hello,

I need to send a UDP package with this function( netUDP_Send )

https://www.keil.com/pack/doc/mw/Network/html/group__udp__user__api.html#ga7a82db98b82300e5fd03ce1b7afb6cba

But I don't have remote IP and Port number.  I have added a new variable to get remote IP and Port number but it shows me an error.

NET_ADDR4 addrUDP;

uint32_t udp_cb_func (int32_t socket, const NET_ADDR *addr, const uint8_t *buf, uint32_t len) {
    addrUDP=addr;
    return 0;
}

How can I send a UDP package?

Parents
  • a value of type "const NET_ADDR *" cannot be assigned to an entity of type "NET_ADDR4"

    This is basic 'C' programming - in order to assign one thing to another, they must have compatible types.

    The error message clearly tells you that these two are not compatible.

    So

    • either you need to change one (or both) of the types;
    • or you need to do a conversion before or during the assignment.

    ...

Reply
  • a value of type "const NET_ADDR *" cannot be assigned to an entity of type "NET_ADDR4"

    This is basic 'C' programming - in order to assign one thing to another, they must have compatible types.

    The error message clearly tells you that these two are not compatible.

    So

    • either you need to change one (or both) of the types;
    • or you need to do a conversion before or during the assignment.

    ...

Children
No data