Coder Social home page Coder Social logo

wojciechmigda / tco-ringbeller-legacy Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 282 KB

Submission to the Ringbeller IoT - Cellular Capabilities C++ library challenge hosted by TopCoder.

Home Page: https://www.topcoder.com/challenges/30152757

License: MIT License

CMake 4.97% C++ 94.97% Shell 0.06%
topcoder topcoder-solutions at-commands boost-asio cpp-17 cpp17 boost-spirit-x3

tco-ringbeller-legacy's Introduction

Build and usage

For build and usage instructions please refer to solutions/README.md.

Bugs

Yes, there are bugs.

First, I did not have access to the Quectel EC25 modem, and the only testing I could perform was done with Huawei E3131a data modem. This enabled me to only test basic connectivity and SMS sending scenarios.

For other scenarios I had to rely on available Quectel PDF manual on their AT commands and other information I could dig across the internet.

Linking

It was pointed out by one of the reviewers that on his computer the linker was unable to produce the executable because of missing threading library. While this problem was not visible on my setup, indeed, there's a bug where the compilation options for the library (BOOST_ASIO_DISABLE_THREADS macro) are not propagated as one of the properties of the library target. Hence, the application itself may be compiled requiring threads.

AT+USBCFG

One of the bugs that was uncovered during review phase testing is related how I handle response to the AT+USBCFG command. The way I understood the Quectel description of this command was that the result will be sent back as a +USBCFG URC (weird, but I went with it).

It turns out that the result is sent back just as with any other regular command. As a consequence, my implementation for making and receiving voice calls perpetually waits for +USBCFG URC which never arrives.

RING

This bug is a simple mistake on my part. For handling of an incoming voice call I wanted to wait for a RING notification. Existing AT command response parser was ready for that and RING was one of final result codes which had their own designated enum.

However, in a haste just before completing the voice call functionality I added checking for a 'RING' string literal being received in the response body instead of checking the enum.

ATE

It was pointed out by one of the reviewers that the board the solution was tested with had ATE echo enabled and this caused confusion for my solution.

Installation

make install issued from the build folder will probably install the executable as well. It should only install the library. Also, cmake find module for the library is missing.

Design improvements

While I am mostly satisfied with the design decisions I made, the parser does too much while preparing single response message.

Instead of relying on the parser preparing response message, which comprises of pieces such as body, result code, etc. it should send responses which correspond to single lines received from the modem: final result code (OK, RING, ERROR, etc.), the actual AT response, which also includes URCs (lines which start with + or ^), prompt (> ), and everything else.

Then the responsibility of combining these into the actual expectes response would fall onto the library client. Also, handling of URC would become simpler.

clipp problems

While clipp is a very handy and powerful header-only library for CLI preparation and does a great job with simple cases, as I progressed I have stumbled upon bugs in clipp which resulted in my CLI not being able to properly handle passed valid input.

I was able to work around this by creating a monstrous combo in which each command is paired with the common options and only then summed to form the final CLI. This causes the help message to be very verbose and full repetitions.

tco-ringbeller-legacy's People

Contributors

wojciechmigda avatar

Watchers

 avatar  avatar  avatar

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.