MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / at_client_obj_send

Function at_client_obj_send

components/net/at/src/at_client.c:511–534  ·  view source on GitHub ↗

* Send data to AT server, send data don't have end sign(eg: \r\n). * * @param client current AT client object * @param buf send data buffer * @param size send fixed data size * * @return >0: send data size * =0: send failed */

Source from the content-addressed store, hash-verified

509 * =0: send failed
510 */
511rt_size_t at_client_obj_send(at_client_t client, const char *buf, rt_size_t size)
512{
513 rt_size_t len;
514
515 RT_ASSERT(buf);
516
517 if (client == RT_NULL)
518 {
519 LOG_E("input AT Client object is NULL, please create or get AT Client object!");
520 return 0;
521 }
522
523#ifdef AT_PRINT_RAW_CMD
524 at_print_raw_cmd("sendline", buf, size);
525#endif
526
527 rt_mutex_take(&client->lock, RT_WAITING_FOREVER);
528
529 len = at_utils_send(client->device, 0, buf, size);
530
531 rt_mutex_release(&client->lock);
532
533 return len;
534}
535
536/**
537 * AT client receive fixed-length data.

Callers

nothing calls this directly

Calls 4

at_print_raw_cmdFunction · 0.85
rt_mutex_takeFunction · 0.85
at_utils_sendFunction · 0.85
rt_mutex_releaseFunction · 0.85

Tested by

no test coverage detected