Answer
Nov 26, 2025 - 02:43 PM
To send an SMS message using the QUECTEL EC200U Series QuecOpen SMS API, you can use the `ql_sms_send_msg()` function. Here is a step-by-step guide on how to send an SMS message:
1. **Include the necessary header files:** Make sure to include the required header files in your code:
```c
#include "ql_api_sms.h"
```
2. **Define the recipient's phone number, message content, and encoding method:**
- Define the recipient's phone number.
- Define the message content (up to 140 bytes).
- Choose the SMS encoding method (GSM-7 bit or UCS2).
3. **Call the `ql_sms_send_msg()` function:**
```c
ql_sms_send_msg(nSim, phone_num, data, code);
```
- `nSim`: The (U)SIM card used (0 for (U)SIM card 1, 1 for (U)SIM card 2).
- `phone_num`: The recipient's mobile phone number.
- `data`: The message content.
- `code`: The SMS encoding method (0 for GSM-7 bit, 1 for UCS2).
4. **Check the return value:**
- If the return value is `QL_SMS_SUCCESS`, the SMS message was sent successfully.
- If the return value is an error code, there was an issue with sending the SMS message.
5. **Example:** Sending an SMS message in English using GSM-7 bit encoding:
```c
if (QL_SMS_SUCCESS == ql_sms_send_msg(0, "+1234567890", "Hello, this is a test message", GSM)) {
// SMS sent successfully
} else {
// Error sending SMS
}
```
By following these steps and using the `ql_sms_send_msg()` function with the appropriate parameters, you can send SMS messages using the QUECTEL EC200U Series QuecOpen SMS API.
User Manual Q&A

Add New Comment