Salamek / huawei-lte-api-ts

API For huawei LAN/WAN LTE Modems written in TypeScript
GNU Lesser General Public License v3.0
48 stars 19 forks source link

Fixed the SMS send API (error 100005) #17

Closed icetee closed 2 years ago

icetee commented 2 years ago

This PR improves issue https://github.com/Salamek/huawei-lte-api-ts/issues/15. The 100005 error is ERROR_FORMAT_ERROR.

The web interface sends it this:

<?xml version="1.0" encoding="UTF-8"?>
<request>
  <Index>-1</Index>
  <Phones>
    <Phone>+00001111111</Phone>
  </Phones>
  <Sca></Sca>
  <Content>Hello World!</Content>
  <Length>12</Length>
  <Reserved>1</Reserved>
  <Date>2021-12-29 02:11:51</Date>
</request>

The Node.js sends it this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<request>
  <Index>-1</Index>
  <Phones>
    <Phone>+00001111111</Phone>
  </Phones>
  <Sca/>
  <Content>Hello World!</Content>
  <Length>12</Length>
  <Reserved>1</Reserved>
  <Date>2021-12-29 01:18:22</Date>
</request>

The standalone root parameter and -1 hour doesn't affect, but the "pretty" format yes. If I set false the SMS is sent out.