GithubHelp home page GithubHelp logo

gsmlib's Issues

intToStr sends 0x0 characters as part of the AT command.

When using

echo test | gsmsendsms -C "$service_center" -b 19200 -d "$device" "$mobile_number"

I get a

ME/TA error 'invalid PDU mode parameter' (code 304)

Running it under strace, I see that the ERROR 304 comes in response to:

write(3, "AT+CMGS=18\0\r", 12)    = 12

Note the spurious NUL character there.

This diff:

diff --git a/gsmlib/gsm_util.cc b/gsmlib/gsm_util.cc
index 373592c..f054929 100644
--- a/gsmlib/gsm_util.cc
+++ b/gsmlib/gsm_util.cc
@@ -164,7 +164,7 @@ bool gsmlib::hexToBuf(const std::string &hexString, unsigned char *buf)
 std::string gsmlib::intToStr(int i)
 {
   std::ostringstream os;
-  os << i << std::ends;
+  os << i;
   return os.str();
 }
 

makes that character and the error go away. I don't know enough of C++ to know why that std:ends was there in the first place.

That's tested with the current git HEAD (cd5442d) on Debian unstable (libstdc++6:amd64 7.2.0-16), though the problem was initially seen on Debian jessie (libstdc++6:amd64 4.9.2-10, libgsmme1c2a:amd64 1.10+20120414.gita5e5ae9a-0.2)

It's possible that it is a regression as I didn't get the error on Debian squeeze with the same GSM modem.

Release?

Hello. I gather you're the (not so) new upstream but it looks as though the various distributions (except Debian?) haven't caught on. I suspect this is because they prefer to have an actual release available. Would it be possible to put one out? If nothing is known to be broken, this shouldn't be too much effort. If you do, I can ensure that this is applied on Gentoo. I come here from the FreeSWITCH project, who have been bundling gsmlib in their source tree, but would prefer to rely on distributions if it becomes more widely available.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.