WCHNET_SocketSend怎么发送数据,请指点一下

uint8_t tcp_receive_id;

uint8_t tcp_receive_buf[100];

uint8_t tcp_receive_len;

怎么使用网口发送函数把数据发送出去?

            i = WCHNET_SocketSend(tcp_receive_id, tcp_receive_buf, &tcp_receive_len);   

            if (i == WCHNET_ERR_SUCCESS)

            {

                WCHNET_SocketRecv(tcp_receive_id, NULL, &tcp_receive_len);                                      //Clear sent data

            }

老是警报,程序应该怎么写?

搞定了,发送数据变量tcp_receive_buf不能是8位,改为uint32_t 就没有警报了


要怎么样才能让他发送消息,不能用想法的数据直接替换SocketInf[id].RecvReadPoint吗


image.png




您好,若你想要发送自己想要发的数据,可参考下图这种方式,直接定义一个数组,数组存放想要发送的数据,直接调用WCHNET_SocketSend函数发送数据即可。image.png



只有登录才能回复,可以选择微信账号登录