Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mdmngr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
IOPSYS
mdmngr
Commits
c82017a0
Commit
c82017a0
authored
7 years ago
by
Jakob Olsson
Browse files
Options
Downloads
Patches
Plain Diff
extended documentation with introductionary section on how to use and how to extend library
parent
1ba1302c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libmobile.h
+35
-0
35 additions, 0 deletions
libmobile.h
with
35 additions
and
0 deletions
libmobile.h
+
35
−
0
View file @
c82017a0
...
...
@@ -6,6 +6,41 @@
#include
<libubox/blobmsg.h>
#include
<libubus.h>
/***************************************************
* Libmobile - A 4G Dongle library
*
* Libmobile provides a library to perform basic functionality for a 4G dongle through
* the use of HTTP GET/POST.
*
* All library calls will prepare the GET or POST query, and send the request to the dongle.
* The response from the server is parsed through a callback, <write_func>. The dongle's response
* is then returned. For POST requests the dongle responds with {"result": "success"} on a
* successful query execution, and with {"result": failure"} on an unsuccessful query execution,
* note that an unsuccessful query execution can mean a variety of things such as: incorrect pin,
* wrong input format, value already set, etc. For a GET request the variable's requested for with
* their corresponding values are returned, important to note that even variables that are not
* available within the system will be returned, but with no value set. The return string for all
* calls is the servers response pointed to by a char pointer.
*
*
* How to extend libmobile
*
* To extend this library add a new function with the corresponding documentation. The naming scheme
* should follow the format <mobile_get_{variables}> for GET requests and <mobile_{action_performed}>
* for POST requests. The structure of the calls are that the <mobile_...> functions prepare the query,
* for GET this means providing the variables to request from the dongle, provided as an input to
* <mobile_get_request>, for POST this means providing the POSTFIELDS argument query to the method
* <mobile_post_request>. The dongle's response is parsed through a callback, a pointer is then returned
* pointing to the response.
*
***************************************************/
/***************************************************
* IMPORTANT NOTE
*
* The library calls will allocate memory for the dongle's response and return the pointer to this memory,
* the caller is then responsible for freeing this memory by calling free(returned_pointer).
***************************************************/
/**
* Function: write_to_ubus
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment