element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Internet of Things
  • Technologies
  • More
Internet of Things
Blog Blog #5  Modem Abstraction Layer (MAL)
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Internet of Things to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: james.flynn
  • Date Created: 3 Dec 2018 4:47 PM Date Created
  • Views 701 views
  • Likes 1 like
  • Comments 0 comments
Related
Recommended

Blog #5  Modem Abstraction Layer (MAL)

james.flynn
james.flynn
3 Dec 2018

  • Overview
  • GPS
  • WWAN
  • DEVINFO
  • Summary

Overview

The Modem Abstraction Layer (MAL) is part of the WNC SDK but I consider it separately because it is focused on controlling the LTE modem. The WNC18Qx device uses a Qualcom MDM9207 chipset which contains 4 ARM Cortex-A7 cores.  In this chip, the LTE modem code runs on 3 of the 4 cores while the last core is running eLinux.  As delivered from Qualcom the LTE modem interaction is through a Radio Interface Layer (RIL).  To simplify this interface, WNC created a MAL which implements JSON strings that are used for control.  The MAL runs as a daemon under eLinux, and interacts with the RIL via a Berkley socket connecting the eLinux core with the LTE modem.  Since there can only be one owner of the socket, the MAL is implemented as a singleton class that opens the socket, then sends and receives JSON strings, and closes the socket.

 

The MAL class starts the MAL service when it is initialized the first time. After than, any time you issue a MAL command, a socket to the LTE modem is opened, the request is sent, and if a response is returned it is parsed and the the response returned to the caller.  All the possible MAL commands are listed in the 'Avnet M18Qx LTE IoT API Guide.docx' that is packaged with the WNC SDK.  The classes that utilize the MAL class in this application are:

 

GPS

The GPS class manages acquisition of GPS coordinates for the current LTE modem location by creating a separate thread that executes every second. As long as GPS is enabled, it will check for the current GPS location and if successful, the location and time of this fix is saved then a flag is set to indicate valid GPS data is available. A caller is then able to retrieve the data as necessary.

 

WWAN

The WWAN class implements the functionality for managing the WWAN LED which indicates the connection status of the LTE Modem.  Because this is an on-going/continuous activity, a thread is created that runs every 2 seconds, queries the LTE Modem status, then updates the LED status.

 

DEVINFO

The Device Info class is the simplest of the classes as it only implements the functions to access the ICCID and IMEI and return the results as strings to the caller. 

 

Summary

There are many other features that could be included in the application:

  • Azure Twins - with this, you could update the state in the Twin and then have it automatically update the device--very nice if you are working with the proper back-end application in place.
  • Provisioning - it allows you to provision a device without recompiling and reflashing code in a device (even one that may be out in the field)
  • Azure Firmware Updates - Implements the process of downloading a new image to the device.  Once it is on the device, it would require a seperate effort to update the flash, but in the case of this example application running on eLinux, it would be simply replacing the application which would be a lot easier to do.

 

I did not included them because I figured that the software was already sufficiently feature dense. I may add them in the future and if I do, all post another blog at that time.  The current application utilizes an HTTP transport, but some features listed above require MQTT or AMPQ.  I have tested the current software with the MQTT transport and it works fine, but getting the cloud side (back-end application) running will take some effort as it is a new area for me.

 

If you find this series of Blogs helpful or educational, please do let me know. I'm always looking for opportunities to help out the community implement/learn about currently available technology!

 

 

Previous Blog

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube