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

Add upd support #50

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open

Conversation

feinstein
Copy link
Contributor

Corrected several things from master (as explained in the 9734329 commit, copied below), but specially made new TCPIP methods so now it's possible to send data over a UDP or TCP connection. Also I made methods for enabling and disabling the GPRS connection. I don't understand why there is the AT+SAPBR command in the original enable(onoff) method, since the TCPIP manual don't even mentions it. I think these names (enable and disable) make more sense and the code is easier to read, also it's full compliant with the TCPIP Manual. could someone please tell me why there is the AT+SAPBR command in the original method? I never could make it work, and also I can't see the need for it.

My code is tested on UDP connetions (I don't have a TCP socket to test, but I can't see why it should't work too).

All this changes I already had for a couple months, I was just testing them in my project before sending. Some of my modifications were already applied in the library in the past commits, as the lack of AT+CIICR .... but still you need AT+CIFSR.

Feel free to discuss my modifications, I understand merge won't be automatic, since I am in a pretty old common base commit, but I tried to make things easier by applying all your recent commits to my branch.


Commit 9734329 message:

Corrected the timeout of some AT commands (CIPSHUT, SAPBR, CIICR), taking the Max Response Time from the AT Command Manual, but leaving a little bit of safe margin too.
Changed some F("OK") left to ok_reply.
Fixed the begin method to have the right parameter type.
Removed some PSTR left in code since the major re-organization, so there could be better portability.
Removed the ADAFRUIT_FONA_DEBUG as "on" as default. I guess most users won't wan't this on at firts, since this only helps coders of the library.
Changed all the TCPIP methods. The old ones were left for backward compatibility.
Added the hability to have a TCP or a UDP connection. Code is all commented.
Added the enableGPRS() and disableGPRS(). The old enableGPRS(onoff) was left for backward compatibility.
Changed the way the APN is stored, now all strings are stored in RAM memory so the user can change APN propetries on the fly if needed, without the need to recompile the code (but still can be passed as flash memory strings).
Added new string manipulation functions Macros for progmem strings compatibility.


EDIT:

I found out that although the SAPBR commands aren't needed for TCPIP commands, they are needed for the HTTP, FTP, GSM location and maybe other functionalities to work. Added it on the e135e3f commit.

feinstein and others added 17 commits November 12, 2015 17:50
… they can be modified easily at runtime.

Added some commands that are needed to open the TCPIP connection, like CSTT, CIICR and CIFSR, according to the Application Note.
All this changes were tested with a UDP connection.
Converted some strings in code to be on flash memory address space instead.
Added a time delay to test for the CSTT answer.
Added methods to fix the TCPIP client port number, or to make it dinamyc allocated.
Changed to tests for UDP first, since UDP is used in performance based aplications, this will be preferred (little impact, but, why not?).
conditional compile for Adafruit Feather M0 and other SAMD boards:
removes SoftwareSerial
added automatic delete of incoming message so that slots don’t all fill
up
v 1.3.1, reflects update to FONA_SMS_Response example
- Ensure the command is sent on one line by replacing some println() by print()
- Remove duplicated send to AT+CSTT
- Use expectReply() for AT+CSTT answer check and only return on failure
…king the Max Response Time from the AT Command Manual, but leaving a little bit of safe margin too.

Changed some F("OK") left to ok_reply.
Fixed the begin method to have the right parameter type.
Removed some PSTR left in code since the major re-organization, so there could be better portability.
Removed the ADAFRUIT_FONA_DEBUG as "on" as default. I guess most users won't wan't this on at firts, since this only helps coders of the library.
Changed all the TCPIP methods. The old ones were left for backward compatibility.
Added the hability to have a TCP or a UDP connection. Code is all commented.
Added the enableGPRS() and disableGPRS(). The old enableGPRS(onoff) was left for backward compatibility.
Changed the way the APN is stored, now all strings are stored in RAM memory so the user can change APN propetries on the fly if needed, without the need to recompile the code (but still can be passed as flash memory strings).
Added new string manipulation functions Macros for progmem strings compatibility.
@ladyada
Copy link
Member

ladyada commented Jan 22, 2016

it will be a while till i do another run at FONA updates - have a large number of other libraries needing updates. but note that i really dont want to merge any code with malloc/free, its just too risky on a 2KB uno. better to have a fixed buffer size for APN details, then strcpy them around?

@feinstein
Copy link
Contributor Author

Agreed, I don't think also anyone will need more than 100 characters for
each of the strings.

I will fix this and push it soon.

@feinstein
Copy link
Contributor Author

@ladyada fixed.

…ods.

The Bearer Profile has to be configured to have HTTP, GSM Location and other functionalities from the modem.
… the constructor, giving him more flexibility on his memory management.

Updated the examples to reflect all the modifications done so far in the library.
@feinstein feinstein mentioned this pull request Jul 2, 2019
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

Successfully merging this pull request may close these issues.

5 participants