添加 assert(Port, "Port为空,不能发送数据") 提示
This commit is contained in:
parent
084903a9e6
commit
49181738f1
|
@ -154,7 +154,6 @@ bool Controller::Reply(Message& msg)
|
||||||
bool Controller::SendInternal(const Message& msg)
|
bool Controller::SendInternal(const Message& msg)
|
||||||
{
|
{
|
||||||
TS("Controller::SendInternal");
|
TS("Controller::SendInternal");
|
||||||
|
|
||||||
// 如果没有传输口处于打开状态,则发送失败
|
// 如果没有传输口处于打开状态,则发送失败
|
||||||
if (!Port->Open()) return false;
|
if (!Port->Open()) return false;
|
||||||
|
|
||||||
|
@ -169,6 +168,8 @@ bool Controller::SendInternal(const Message& msg)
|
||||||
|
|
||||||
bool Controller::SendInternal(const Buffer& bs, const void* state)
|
bool Controller::SendInternal(const Buffer& bs, const void* state)
|
||||||
{
|
{
|
||||||
|
assert(Port, "Port为空,不能发送数据");
|
||||||
|
|
||||||
if (state == nullptr)
|
if (state == nullptr)
|
||||||
return Port->Write(bs);
|
return Port->Write(bs);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue