MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / isApiMessage

Function isApiMessage

app/src/API/CommandProtocol.h:199–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199inline bool isApiMessage(const QByteArray& data)
200{
201 if (data.isEmpty())
202 return false;
203
204 const auto trimmed = data.trimmed();
205 if (trimmed.isEmpty() || trimmed.at(0) != '{')
206 return false;
207
208 QString type;
209 QJsonObject json;
210 if (!parseMessage(data, type, json))
211 return false;
212
213 return type == MessageType::Command || type == MessageType::Batch || type == MessageType::Raw;
214}
215
216} // namespace API

Callers 1

isApiMessageMethod · 0.85

Calls 2

parseMessageFunction · 0.85
isEmptyMethod · 0.80

Tested by

no test coverage detected