Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: mbed-TFT-example-NCS36510 mbed-Accelerometer-example-NCS36510 mbed-Accelerometer-example-NCS36510
features/unsupported/net/cellular/CellularModem/sms/CDMASMSInterface.h@1:f30bdcd2b33b, 2017-02-27 (annotated)
- Committer:
- jacobjohnson
- Date:
- Mon Feb 27 17:45:05 2017 +0000
- Revision:
- 1:f30bdcd2b33b
- Parent:
- 0:098463de4c5d
changed the inputscale from 1 to 7 in analogin_api.c. This will need to be changed later, and accessed from the main level, but for now this allows the adc to read a value from 0 to 3.7V, instead of just up to 1V.;
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| group-onsemi | 0:098463de4c5d | 1 | /* SMSInterface.h */ | 
| group-onsemi | 0:098463de4c5d | 2 | /* Copyright (C) 2012 mbed.org, MIT License | 
| group-onsemi | 0:098463de4c5d | 3 | * | 
| group-onsemi | 0:098463de4c5d | 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software | 
| group-onsemi | 0:098463de4c5d | 5 | * and associated documentation files (the "Software"), to deal in the Software without restriction, | 
| group-onsemi | 0:098463de4c5d | 6 | * including without limitation the rights to use, copy, modify, merge, publish, distribute, | 
| group-onsemi | 0:098463de4c5d | 7 | * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is | 
| group-onsemi | 0:098463de4c5d | 8 | * furnished to do so, subject to the following conditions: | 
| group-onsemi | 0:098463de4c5d | 9 | * | 
| group-onsemi | 0:098463de4c5d | 10 | * The above copyright notice and this permission notice shall be included in all copies or | 
| group-onsemi | 0:098463de4c5d | 11 | * substantial portions of the Software. | 
| group-onsemi | 0:098463de4c5d | 12 | * | 
| group-onsemi | 0:098463de4c5d | 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING | 
| group-onsemi | 0:098463de4c5d | 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | 
| group-onsemi | 0:098463de4c5d | 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | 
| group-onsemi | 0:098463de4c5d | 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | 
| group-onsemi | 0:098463de4c5d | 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | 
| group-onsemi | 0:098463de4c5d | 18 | */ | 
| group-onsemi | 0:098463de4c5d | 19 | |
| group-onsemi | 0:098463de4c5d | 20 | #ifndef CDMASMSINTERFACE_H_ | 
| group-onsemi | 0:098463de4c5d | 21 | #define CDMASMSINTERFACE_H_ | 
| group-onsemi | 0:098463de4c5d | 22 | |
| group-onsemi | 0:098463de4c5d | 23 | #include "SMSInterface.h" | 
| group-onsemi | 0:098463de4c5d | 24 | |
| group-onsemi | 0:098463de4c5d | 25 | #define MAX_SM 8 | 
| group-onsemi | 0:098463de4c5d | 26 | |
| group-onsemi | 0:098463de4c5d | 27 | /** Component to use the Short Messages Service (SMS) | 
| group-onsemi | 0:098463de4c5d | 28 | * | 
| group-onsemi | 0:098463de4c5d | 29 | */ | 
| group-onsemi | 0:098463de4c5d | 30 | class CDMASMSInterface : public ISMSInterface, protected IATCommandsProcessor | 
| group-onsemi | 0:098463de4c5d | 31 | { | 
| group-onsemi | 0:098463de4c5d | 32 | public: | 
| group-onsemi | 0:098463de4c5d | 33 | /** Create SMSInterface instance | 
| group-onsemi | 0:098463de4c5d | 34 | @param pIf Pointer to the ATCommandsInterface instance to use | 
| group-onsemi | 0:098463de4c5d | 35 | */ | 
| group-onsemi | 0:098463de4c5d | 36 | CDMASMSInterface(ATCommandsInterface* pIf); | 
| group-onsemi | 0:098463de4c5d | 37 | |
| group-onsemi | 0:098463de4c5d | 38 | /** Initialize interface | 
| group-onsemi | 0:098463de4c5d | 39 | Configure SMS commands & register for SMS-related unsolicited result codes | 
| group-onsemi | 0:098463de4c5d | 40 | */ | 
| group-onsemi | 0:098463de4c5d | 41 | virtual int init(); | 
| group-onsemi | 0:098463de4c5d | 42 | |
| group-onsemi | 0:098463de4c5d | 43 | /** Send a SM | 
| group-onsemi | 0:098463de4c5d | 44 | @param number The receiver's phone number | 
| group-onsemi | 0:098463de4c5d | 45 | @param message The message to send | 
| group-onsemi | 0:098463de4c5d | 46 | @return 0 on success, error code on failure | 
| group-onsemi | 0:098463de4c5d | 47 | */ | 
| group-onsemi | 0:098463de4c5d | 48 | virtual int send(const char* number, const char* message); | 
| group-onsemi | 0:098463de4c5d | 49 | |
| group-onsemi | 0:098463de4c5d | 50 | |
| group-onsemi | 0:098463de4c5d | 51 | /** Receive a SM | 
| group-onsemi | 0:098463de4c5d | 52 | @param number Pointer to a buffer to store the sender's phone number (must be at least 17 characters-long, including the space for the null-terminating char) | 
| group-onsemi | 0:098463de4c5d | 53 | @param message Pointer to a buffer to store the the incoming message | 
| group-onsemi | 0:098463de4c5d | 54 | @param maxLength Maximum message length that can be stored in buffer (including null-terminating character) | 
| group-onsemi | 0:098463de4c5d | 55 | @return 0 on success, error code on failure | 
| group-onsemi | 0:098463de4c5d | 56 | */ | 
| group-onsemi | 0:098463de4c5d | 57 | virtual int get(char* number, char* message, size_t maxLength); | 
| group-onsemi | 0:098463de4c5d | 58 | |
| group-onsemi | 0:098463de4c5d | 59 | |
| group-onsemi | 0:098463de4c5d | 60 | /** Get the number of SMs in the incoming box | 
| group-onsemi | 0:098463de4c5d | 61 | @param pCount pointer to store the number of unprocessed SMs on | 
| group-onsemi | 0:098463de4c5d | 62 | @return 0 on success, error code on failure | 
| group-onsemi | 0:098463de4c5d | 63 | */ | 
| group-onsemi | 0:098463de4c5d | 64 | virtual int getCount(size_t* pCount); | 
| group-onsemi | 0:098463de4c5d | 65 | |
| group-onsemi | 0:098463de4c5d | 66 | protected: | 
| group-onsemi | 0:098463de4c5d | 67 | //IATCommandsProcessor | 
| group-onsemi | 0:098463de4c5d | 68 | virtual int onNewATResponseLine(ATCommandsInterface* pInst, const char* line); | 
| group-onsemi | 0:098463de4c5d | 69 | virtual int onNewEntryPrompt(ATCommandsInterface* pInst); | 
| group-onsemi | 0:098463de4c5d | 70 | |
| group-onsemi | 0:098463de4c5d | 71 | int updateInbox(); //Update messages count in the different inboxes | 
| group-onsemi | 0:098463de4c5d | 72 | |
| group-onsemi | 0:098463de4c5d | 73 | private: | 
| group-onsemi | 0:098463de4c5d | 74 | ATCommandsInterface* m_pIf; | 
| group-onsemi | 0:098463de4c5d | 75 | |
| group-onsemi | 0:098463de4c5d | 76 | //Current message | 
| group-onsemi | 0:098463de4c5d | 77 | char* m_msg; | 
| group-onsemi | 0:098463de4c5d | 78 | size_t m_maxMsgLength; | 
| group-onsemi | 0:098463de4c5d | 79 | char* m_msisdn; | 
| group-onsemi | 0:098463de4c5d | 80 | |
| group-onsemi | 0:098463de4c5d | 81 | //Messages list | 
| group-onsemi | 0:098463de4c5d | 82 | size_t m_msgInListsCount[4]; //4 lists | 
| group-onsemi | 0:098463de4c5d | 83 | |
| group-onsemi | 0:098463de4c5d | 84 | size_t m_headersToRead; | 
| group-onsemi | 0:098463de4c5d | 85 | |
| group-onsemi | 0:098463de4c5d | 86 | enum { SMS_NONE, SMS_SENT, SMS_PENDING, SMS_FAILED } m_txState; | 
| group-onsemi | 0:098463de4c5d | 87 | enum { SMS_IDLE, SMS_SEND_CMD_SENT, SMS_GET_TX_STATUS_CMD_SENT, SMS_GET_CMD_SENT, SMS_GET_HDR_RECEIVED, SMS_GET_COUNT_CMD_SENT, SMS_CMD_PROCESSED } m_state; | 
| group-onsemi | 0:098463de4c5d | 88 | }; | 
| group-onsemi | 0:098463de4c5d | 89 | |
| group-onsemi | 0:098463de4c5d | 90 | #endif /* CDMASMSINTERFACE_H_ */ |