Library driver for the u-blox SARA-N200 NB-IoT modem
Dependents: sara-n200-hello-mqtt-sn
Revision 2:9b9276791c59, committed 2018-08-22
- Comitter:
- KeystoneElectronic
- Date:
- Wed Aug 22 16:37:03 2018 +0200
- Parent:
- 1:34946e5c54a2
- Commit message:
- Add SIM and IMEA
Changed in this revision
sara-n2.cpp | Show annotated file Show diff for this revision Revisions of this file |
sara_n2.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 34946e5c54a2 -r 9b9276791c59 sara-n2.cpp --- a/sara-n2.cpp Tue Aug 21 16:38:20 2018 +0200 +++ b/sara-n2.cpp Wed Aug 22 16:37:03 2018 +0200 @@ -19,6 +19,8 @@ mTimer.start(); mElapsed = mTimer.read_ms(); *mReset = 0; + mSIMserial[0] = 0; + mIMEA[0] = 0; //mCMD.debug_on(1); mCMD.set_timeout(500); @@ -109,6 +111,7 @@ break; TRACE("IMEA: %s\n", model); + strcpy(mIMEA, model); mState = MODEM_SIM_PIN; } @@ -121,6 +124,7 @@ break; TRACE("SIM: %s\n", SIMID); + strcpy(mSIMserial, SIMID); // mCMD.send("AT+CFUN=1"); // if(!mCMD.recv("OK"))
diff -r 34946e5c54a2 -r 9b9276791c59 sara_n2.h --- a/sara_n2.h Tue Aug 21 16:38:20 2018 +0200 +++ b/sara_n2.h Wed Aug 22 16:37:03 2018 +0200 @@ -32,7 +32,8 @@ ATCmdParser mCMD; DigitalOut *mReset; eModemState mState; - + char mSIMserial[32]; + char mIMEA[32]; int mElapsed; Timer mTimer; @@ -46,9 +47,11 @@ bool disconnect(int id); static void receiveData(SARA_N2 *_this); + char *getSIMserial(){ return mSIMserial; } + char *getIMEA(){ return mIMEA; } int read(int sock_id, char *host, int *port, uint8_t *buff, int len, int timeout); int write(int sock_id, char *host, int port, uint8_t *buff, int len, int timeout); }; -#endif /* SRC_SARA_N2_H_ */ \ No newline at end of file +#endif /* SRC_SARA_N2_H_ */