Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TPDU library. #1

Open
moteus opened this issue Mar 14, 2016 · 4 comments
Open

TPDU library. #1

moteus opened this issue Mar 14, 2016 · 4 comments

Comments

@moteus
Copy link

moteus commented Mar 14, 2016

Did you see my lua-tpdu library.
It low-level encoder/decoder wich also support multi-part sms.
It does not provide any object just encode/decode from/to Lua table.

This library was written to lluv-gsmmodem library.

@0x4C4A
Copy link
Owner

0x4C4A commented Mar 14, 2016

Gosh, no, I completely missed that one.
Yours seems to be missing UTF-16bit encoding, which is at least something I haven't pointlessly duplicated. :)
Can I contact you on some more IM style network to discuss the library a bit?

@moteus
Copy link
Author

moteus commented Mar 14, 2016

sms does not use utf-16. it uses ucs2. lua-tpdu does not do any conversions it just return binary string and encoding. lluv-gsmmodem uses iconv library to convert text.

@0x4C4A
Copy link
Owner

0x4C4A commented Mar 14, 2016

Indeed, a bit of oversight on my part.
In fact, the lluv-gsmmodem library seems like what I'd need, however it drags in a whole load of dependancies which is not really what I'd want (need this on an embedded Linux machine). Any tips?

@moteus
Copy link
Author

moteus commented Mar 15, 2016

You can try use at.lua module. It provides AT commands protocol.
This is link for test
You need create ATStream object and implement on_command callback to write raw data to serial port. When you read data from serial port you need call stream:append(data) and to execute callbacks you need call stream:execute()
Commands implemented in ATCommand class.

stream  = at.Stream(SELF)
stream:on_command(function(self, cmd)
  -- write cmd to serial port
end)

command = at.Commander(stream)

-- proceed URC data (sms, call, boot)
command:on_urc(function(self, err, ....) ... end)

-- execute command
command:ATZ(function(self, err, res) ... end)

-- proceed data from port
data = read_from_sereal_port()
stream:append(data)
stream:execute()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants