-
Notifications
You must be signed in to change notification settings - Fork 3k
Cellular: BC95 echo test fixes #6291
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright (c) 2017, Arm Limited and affiliates. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#include "QUECTEL_BC95_CellularSIM.h" | ||
#include "CellularLog.h" | ||
|
||
using namespace mbed; | ||
|
||
QUECTEL_BC95_CellularSIM::QUECTEL_BC95_CellularSIM(ATHandler &atHandler) : AT_CellularSIM(atHandler) | ||
{ | ||
|
||
} | ||
|
||
QUECTEL_BC95_CellularSIM::~QUECTEL_BC95_CellularSIM() | ||
{ | ||
|
||
} | ||
|
||
nsapi_error_t QUECTEL_BC95_CellularSIM::get_sim_state(SimState &state) | ||
{ | ||
_at.lock(); | ||
_at.flush(); | ||
_at.cmd_start("AT+NCCID?"); | ||
_at.cmd_stop(); | ||
_at.resp_start("+NCCID:"); | ||
if (_at.info_resp()) { | ||
state = SimStateReady; | ||
} else { | ||
tr_warn("SIM not readable."); | ||
state = SimStateUnknown; // SIM may not be ready yet | ||
} | ||
_at.resp_stop(); | ||
return _at.unlock_return_error(); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (c) 2017, Arm Limited and affiliates. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef QUECTEL_BC95_CELLULAR_SIM_H_ | ||
#define QUECTEL_BC95_CELLULAR_SIM_H_ | ||
|
||
#include "AT_CellularSIM.h" | ||
|
||
namespace mbed { | ||
|
||
class QUECTEL_BC95_CellularSIM : public AT_CellularSIM | ||
{ | ||
public: | ||
QUECTEL_BC95_CellularSIM(ATHandler &atHandler); | ||
virtual ~QUECTEL_BC95_CellularSIM(); | ||
|
||
public: //from CellularSIM | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Funky. Is there a specific reason why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not really. It is copied from other modules where it is used for specifying in comments the different interfaces the class is implementing, but of course comment alone would be enough. |
||
virtual nsapi_error_t get_sim_state(SimState &state); | ||
}; | ||
|
||
} // namespace mbed | ||
|
||
#endif // QUECTEL_BC95_CELLULAR_SIM_H_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason the constructor and destructor are empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "empty" constructor is needed for passing atHandler to base AT_CellularSIM.
But empty destructor is not needed.