Commit Graph

640 Commits (b9d824d67cb15cf43a205aa5c78336aaa2aaeecf)

Author SHA1 Message Date
Kimmo Vaisanen a7868daa89 Cellular: Change visibility of _is_connected as protected
AT_CellularContext::do_connect() is a virtual API and therefore can be overwritten in
inherited class. The problem was that it sets AT_CellularContext::_is_connected flag but
earlier it was set as private member making it impossible to set in overwritten do_connect()
method.

This commit fixes the problem by changing _is_connected as protected enabling its use
in inherited class.
2019-11-18 15:42:08 +00:00
mudassar-ublox d12a051068 setting timeout before send command 2019-10-16 11:58:32 +01:00
Ari Parkkila 5b9741094f Cellular: Fix CellularStateMachine to not loop on power state 2019-10-16 11:58:32 +01:00
Ari Parkkila 2eab0fbee4 Cellular: Fix resolving of DNS server IPv4/6 address 2019-10-16 11:58:32 +01:00
int_szyk 85f104755f CellularStack: remove unnecessary assignment.
Fixes Coverity issue about unused variable.
2019-10-16 11:53:52 +01:00
int_szyk 2d2fdf7cf9 CellularUtil prefer_ipv6: check length.
Fixes Coverity issue about not checking the length of string before copying it.
2019-10-16 11:53:52 +01:00
Janne Kiiskila 04767f3022 AT_CellularDevice.cpp - unused variable err warning
We get this compiler warning;

Compile [  7.9%]: AT_CellularDevice.cpp
[Warning] AT_CellularDevice.cpp@206,18: variable 'err' set but not used [-Wunused-but-set-variable]

Due to the fact, that the code that would actually use this variable
is behind trace flags. Based on review feedback from Antti Kauppila and
Kimmo Väisänen, adding same flagging also for that.
- Reason being - the operation needs to be within the locks.
2019-10-16 11:53:52 +01:00
Ari Parkkila 78f3292036 Cellular: Fix setting of PDP context ID (cid) 2019-10-16 11:53:52 +01:00
Mirela Chirica 9dab079d33 Cellular: Removed not used variable 2019-10-16 11:53:52 +01:00
Mirela Chirica d48ea364ff Cellular: Include of errno.h needed for Mac OS X 2019-10-16 11:53:52 +01:00
Kimmo Vaisanen 5ae3b078d4 Add UT for AT_CellularNetwork::is_active_context 2019-10-16 11:53:52 +01:00
Kimmo Vaisanen a6eed00d5b Add UT for CellularUtil::hex_to_char and ::hex_str_to_char_str
Also added checks for pointer validity.
2019-10-16 11:53:52 +01:00
Kimmo Vaisanen 76171e54e7 Cellular: Handle SEND FAIL and ERROR response
QISEND command can respond either SEND OK, SEND FAIL or ERROR.
If response is not SEND OK, sent bytes should not be checked but
error should be reported.
2019-10-16 11:53:52 +01:00
Mirela Chirica 2d967dacbf Cellular: Enable IPV6 for WISE_1570 2019-10-16 11:53:52 +01:00
Kimmo Vaisanen 2bf62bf4c5 Cellular: Fix get_interface_name to not include leading zero
Multihoming documentation about interface name:
"Two character name string is concatenated with 8 bit value containing index which is incremented on each netif addition"

Cellular uses context id as index and to follow LWIP (LWIP::Interface::get_interface_name), index does not include leading zeros.
2019-10-16 11:53:52 +01:00
Ari Parkkila 31528016b5 Cellular: Add flow control (IFC) in BG96 AT driver 2019-10-16 11:53:52 +01:00
Kimmo Vaisanen c5c0261737 Cellular: Fix stop tag for Quectel M26 send command
Possible responses for send command are SEND OK<cr><ln>, SEND FAIL<cr><ln> or ERROR<cr><ln>
so normal OK<cr><ln> response check does not work properly.
2019-10-16 11:53:52 +01:00
Mirela Chirica 2cc2d690be Cellular: Enable IPv6 stack property for BG96 2019-10-16 11:53:52 +01:00
Mirela Chirica 1b43450607 Cellular: Check IP version of send to address 2019-10-16 11:53:52 +01:00
Mirela Chirica 4078b6f398 Cellular: IP stack property redefined 2019-10-16 11:53:52 +01:00
Mirela Chirica a846eb3c3c Cellular: Stack type based on assigned IP addresses versions 2019-10-16 11:53:52 +01:00
Ari Parkkila aea8d824cb Cellular: Fix BG96 power on and connect 2019-10-16 11:53:52 +01:00
George Psimenos 499bc28a32 Avoid potential overflow 2019-10-16 11:53:52 +01:00
George Psimenos cc16a2cfd6 Replace difftime and float literals 2019-10-16 11:53:52 +01:00
Hugues Kamba 95996200d7 Use PRIu32 to print uint32_t variable
As the variable underlying type size is different depending on the
toolchain used
2019-10-16 11:53:52 +01:00
Hugues Kamba 7bdc7b6a69 Remove minor build warnings 2019-10-16 11:53:52 +01:00
Hugues Kamba 908241fb48 Replace wait_ms calls with rtos::ThisThread::sleep_for
`wait_ms` is deprecated and its use generates a warning.
2019-10-16 11:53:52 +01:00
Teppo Järvelin 4608de3e1a Cellular: fix ATHandler destructor possible crash on delete
In some multithread cases there is possibility that process_oob function
was called after ATHandler was deleted. Fix is to wait if oob processing
is ongoing.
2019-10-16 11:53:52 +01:00
adbridge 40028c8453 Fix added to unlock AT handler mutex
This is a manual commit to bring the contents of PR11526 across.
The original commit could not be cherry-picked or patched!
2019-09-19 16:37:08 +01:00
Syed Fahimuddin Alavi fe34ed0e05 Bux fix: Context can be cleared using CGDCONT after sim ready state 2019-09-19 16:27:02 +01:00
Martin Kojtal 39733cbc0b
Merge pull request #11306 from AnttiKauppila/ATHandler_improvements
At handler improvements
2019-09-02 12:08:44 +02:00
Antti Kauppila 9151606bb2 AT locks placed for UBlox AT handling 2019-08-30 08:54:34 +03:00
Martin Kojtal de627dad6a Merge branch 'read-int-zero' of git://github.com/dextero/mbed-os into dev_rollup 2019-08-28 18:37:46 +01:00
Antti Kauppila d08d55da88 New ATHandler functions taken into use
New ATHandler functions taken into use for rest of the targets (BG96 was updated initially) to reduce code size. This means basically that new functions using variadic list approach are taken into use and with those one can usually write AT commands in single line instead of multiple lines.
Only internal changes and API's are not modified.
2019-08-27 09:15:51 +03:00
Martin Kojtal a1540c5f77
Merge pull request #11245 from dextero/8bit-sms
AT_CellularSMS: allow configuring SMS encoding (7-bit/8-bit) at initialization
2019-08-23 13:51:59 +02:00
Martin Kojtal 88dcf27e02
Merge pull request #11246 from AriParkkila/cell-bg96-ipv6
Cellular: Fix BG96 AT driver for IPv6
2019-08-22 11:08:23 +02:00
Martin Kojtal 5c09ff12ac
Merge pull request #11220 from jarvte/fix_cellular_dns_test
Fix cellular dns test with IAR compiled binary
2019-08-22 10:57:22 +02:00
Ari Parkkila 110fb7d524 Cellular: Fix BG96 AT driver for IPv6 2019-08-21 02:46:33 -07:00
Martin Kojtal 0b49952b9e
Merge pull request #11249 from dextero/get-sms-zero
Make AT_CellularSMS::list_messages support index 0 in SMS inbox
2019-08-20 10:27:57 +02:00
Martin Kojtal 9ccfe49d12
Merge pull request #11247 from dextero/international-numbers
AT_CellularSMS: set "international" flag in PDU when applicable
2019-08-20 10:27:13 +02:00
Martin Kojtal b849bc1e3d
Merge pull request #11201 from mirelachirica/bug_virtual_in_constructor
Cellular: Fixed improper AT handler setup through virtual calls in co…
2019-08-20 09:52:28 +02:00
Martin Kojtal a5a2036c65
Merge pull request #11224 from AnttiKauppila/Coverity_fixes
Coverity issues fixed
2019-08-20 09:40:20 +02:00
Marcin Radomski 17f6f1c0e3 Make AT_CellularSMS support index 0 in SMS inbox
When AT+CGML is used to retrieve list of SMS stored in modem inbox,
every message has an associated index. ETSI TS 127 005 v7.0.0 does not
specify what is the allowed range of such indices - all it says is
"integer type; value in the range of location numbers supported by the
associated memory".

Usually, AT modems use positive indexes (starting at 1). Quectel BG96
modem takes a different approach, indexing messages starting at 0.

Current implementation of `AT_CellularSMS::list_messages()` considers
index 0 invalid and ignores such message, effectively making it
impossible to access using mbed-os API.

This commit changes the behavior so that value of 0 is handled as any
other positive message index.
2019-08-16 14:19:29 +02:00
Marcin Radomski 726eace763 Do not fail on trailing data in read_int
Some tests depend on that behavior.
2019-08-16 14:14:58 +02:00
Marcin Radomski c0032c9055 ATHandler::read_int: allow returning 0 successfully 2019-08-16 14:14:58 +02:00
Marcin Radomski 2bfa4e9b8d AT_CellularSMS: set "international" flag in PDU when applicable
Currently, create_pdu receives a destination address without '+' prefix,
and always sets the "type of address" to "unknown". That means, the
number needs to contain appropriate international number prefix (00/011)
if necessary - which is not the case if the leading + is simply
stripped.

This changes send_sms behavior so that when a SMS is sent to an
international number (indicated by leading +):

- AT+CMGS command receives the number with + prefix,
- created PDU has the "international" flag set.
2019-08-16 13:30:59 +02:00
Marcin Radomski f3e9501ac6 Increase PDU buffer size to fit 8-bit-encoded hex string 2019-08-16 13:20:37 +02:00
Marcin Radomski 14f8d15242 Add option to set up SMS encoding 2019-08-16 12:24:54 +02:00
Mirela Chirica 75c823c1a3 Cellular: Fixed improper AT handler setup through virtual calls in constructor
Added AT handler setup method to be used for initialisation routines
that are virtual and therefore cannot be called from constructor.
2019-08-16 10:57:37 +03:00
Anna Bridge 2af2b1b18b
Merge pull request #11190 from jarvte/fix_wise1570_netsocket_tests
Cellular: failure when deleting created context is not considered error
2019-08-15 12:58:32 +01:00