mirror of
https://github.com/espressif/openthread.git
synced 2026-09-13 04:30:08 +00:00
[coap] use otError in C handlers (#11115)
This commit changes CoAP handlers to use otError in the function or method definitions. This ensures the definitions are consistent with the declaration in coap.h.
This commit is contained in:
@@ -372,7 +372,7 @@ exit:
|
||||
void BorderAgent::HandleCoapResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult)
|
||||
otError aResult)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aMessageInfo);
|
||||
|
||||
|
||||
@@ -305,7 +305,7 @@ private:
|
||||
static void HandleCoapResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult);
|
||||
otError aResult);
|
||||
void HandleCoapResponse(const ForwardContext &aForwardContext, const Coap::Message *aResponse, Error aResult);
|
||||
static bool HandleUdpReceive(void *aContext, const otMessage *aMessage, const otMessageInfo *aMessageInfo);
|
||||
bool HandleUdpReceive(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
|
||||
|
||||
@@ -633,7 +633,7 @@ exit:
|
||||
void Commissioner::HandleMgmtCommissionerGetResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult)
|
||||
otError aResult)
|
||||
{
|
||||
static_cast<Commissioner *>(aContext)->HandleMgmtCommissionerGetResponse(AsCoapMessagePtr(aMessage),
|
||||
AsCoreTypePtr(aMessageInfo), aResult);
|
||||
@@ -704,7 +704,7 @@ exit:
|
||||
void Commissioner::HandleMgmtCommissionerSetResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult)
|
||||
otError aResult)
|
||||
{
|
||||
static_cast<Commissioner *>(aContext)->HandleMgmtCommissionerSetResponse(AsCoapMessagePtr(aMessage),
|
||||
AsCoreTypePtr(aMessageInfo), aResult);
|
||||
@@ -757,7 +757,7 @@ exit:
|
||||
void Commissioner::HandleLeaderPetitionResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult)
|
||||
otError aResult)
|
||||
{
|
||||
static_cast<Commissioner *>(aContext)->HandleLeaderPetitionResponse(AsCoapMessagePtr(aMessage),
|
||||
AsCoreTypePtr(aMessageInfo), aResult);
|
||||
@@ -844,7 +844,7 @@ exit:
|
||||
void Commissioner::HandleLeaderKeepAliveResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult)
|
||||
otError aResult)
|
||||
{
|
||||
static_cast<Commissioner *>(aContext)->HandleLeaderKeepAliveResponse(AsCoapMessagePtr(aMessage),
|
||||
AsCoreTypePtr(aMessageInfo), aResult);
|
||||
|
||||
@@ -396,22 +396,22 @@ private:
|
||||
static void HandleMgmtCommissionerSetResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult);
|
||||
otError aResult);
|
||||
void HandleMgmtCommissionerSetResponse(Coap::Message *aMessage,
|
||||
const Ip6::MessageInfo *aMessageInfo,
|
||||
Error aResult);
|
||||
static void HandleMgmtCommissionerGetResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult);
|
||||
otError aResult);
|
||||
void HandleMgmtCommissionerGetResponse(Coap::Message *aMessage,
|
||||
const Ip6::MessageInfo *aMessageInfo,
|
||||
Error aResult);
|
||||
static void HandleLeaderPetitionResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult);
|
||||
void HandleLeaderPetitionResponse(Coap::Message *aMessage, const Ip6::MessageInfo *aMessageInfo, Error aResult);
|
||||
otError aResult);
|
||||
void HandleLeaderPetitionResponse(Coap::Message *aMessage, const Ip6::MessageInfo *aMessageInfo, otError aResult);
|
||||
static void HandleLeaderKeepAliveResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
|
||||
@@ -498,7 +498,7 @@ exit:
|
||||
void DatasetManager::HandleMgmtSetResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aError)
|
||||
otError aError)
|
||||
{
|
||||
static_cast<DatasetManager *>(aContext)->HandleMgmtSetResponse(AsCoapMessagePtr(aMessage),
|
||||
AsCoreTypePtr(aMessageInfo), aError);
|
||||
|
||||
@@ -291,7 +291,7 @@ private:
|
||||
static void HandleMgmtSetResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aError);
|
||||
otError aError);
|
||||
|
||||
#if OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE
|
||||
void MoveKeysToSecureStorage(Dataset &aDataset) const;
|
||||
|
||||
@@ -470,7 +470,7 @@ exit:
|
||||
void Joiner::HandleJoinerFinalizeResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult)
|
||||
otError aResult)
|
||||
{
|
||||
static_cast<Joiner *>(aContext)->HandleJoinerFinalizeResponse(AsCoapMessagePtr(aMessage), &AsCoreType(aMessageInfo),
|
||||
aResult);
|
||||
|
||||
@@ -199,7 +199,7 @@ private:
|
||||
static void HandleJoinerFinalizeResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult);
|
||||
otError aResult);
|
||||
void HandleJoinerFinalizeResponse(Coap::Message *aMessage, const Ip6::MessageInfo *aMessageInfo, Error aResult);
|
||||
|
||||
template <Uri kUri> void HandleTmf(Coap::Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
|
||||
|
||||
@@ -309,7 +309,7 @@ exit:
|
||||
void JoinerRouter::HandleJoinerEntrustResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult)
|
||||
otError aResult)
|
||||
{
|
||||
static_cast<JoinerRouter *>(aContext)->HandleJoinerEntrustResponse(AsCoapMessagePtr(aMessage),
|
||||
AsCoreTypePtr(aMessageInfo), aResult);
|
||||
|
||||
@@ -101,7 +101,7 @@ private:
|
||||
static void HandleJoinerEntrustResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult);
|
||||
otError aResult);
|
||||
void HandleJoinerEntrustResponse(Coap::Message *aMessage, const Ip6::MessageInfo *aMessageInfo, Error aResult);
|
||||
|
||||
void HandleTimer(void);
|
||||
|
||||
@@ -76,7 +76,7 @@ exit:
|
||||
void AnycastLocator::HandleResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aError)
|
||||
otError aError)
|
||||
{
|
||||
static_cast<AnycastLocator *>(aContext)->HandleResponse(AsCoapMessagePtr(aMessage), AsCoreTypePtr(aMessageInfo),
|
||||
aError);
|
||||
|
||||
@@ -93,7 +93,7 @@ public:
|
||||
bool IsInProgress(void) const { return mCallback.IsSet(); }
|
||||
|
||||
private:
|
||||
static void HandleResponse(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo, Error aError);
|
||||
static void HandleResponse(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo, otError aError);
|
||||
|
||||
void HandleResponse(Coap::Message *aMessage, const Ip6::MessageInfo *aMessageInfo, Error aError);
|
||||
|
||||
|
||||
@@ -544,7 +544,7 @@ exit:
|
||||
void DuaManager::HandleDuaResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult)
|
||||
otError aResult)
|
||||
{
|
||||
static_cast<DuaManager *>(aContext)->HandleDuaResponse(AsCoapMessagePtr(aMessage), AsCoreTypePtr(aMessageInfo),
|
||||
aResult);
|
||||
|
||||
@@ -208,7 +208,7 @@ private:
|
||||
static void HandleDuaResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult);
|
||||
otError aResult);
|
||||
void HandleDuaResponse(Coap::Message *aMessage, const Ip6::MessageInfo *aMessageInfo, Error aResult);
|
||||
|
||||
template <Uri kUri> void HandleTmf(Coap::Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
|
||||
|
||||
@@ -3305,7 +3305,7 @@ exit:
|
||||
void MleRouter::HandleAddressSolicitResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult)
|
||||
otError aResult)
|
||||
{
|
||||
static_cast<MleRouter *>(aContext)->HandleAddressSolicitResponse(AsCoapMessagePtr(aMessage),
|
||||
AsCoreTypePtr(aMessageInfo), aResult);
|
||||
|
||||
@@ -649,7 +649,7 @@ private:
|
||||
static void HandleAddressSolicitResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult);
|
||||
otError aResult);
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Variables
|
||||
|
||||
@@ -338,13 +338,13 @@ exit:
|
||||
void MlrManager::HandleRegisterResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult)
|
||||
otError aResult)
|
||||
{
|
||||
static_cast<MlrManager *>(aContext)->HandleRegisterResponse(AsCoapMessagePtr(aMessage), AsCoreTypePtr(aMessageInfo),
|
||||
aResult);
|
||||
}
|
||||
|
||||
void MlrManager::HandleRegisterResponse(otMessage *aMessage, const otMessageInfo *aMessageInfo, Error aResult)
|
||||
void MlrManager::HandleRegisterResponse(otMessage *aMessage, const otMessageInfo *aMessageInfo, otError aResult)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aMessageInfo);
|
||||
|
||||
@@ -428,7 +428,7 @@ exit:
|
||||
void MlrManager::HandleMlrResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult)
|
||||
otError aResult)
|
||||
{
|
||||
static_cast<MlrManager *>(aContext)->HandleMlrResponse(AsCoapMessagePtr(aMessage), AsCoreTypePtr(aMessageInfo),
|
||||
aResult);
|
||||
|
||||
@@ -159,7 +159,7 @@ private:
|
||||
static void HandleMlrResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult);
|
||||
otError aResult);
|
||||
void HandleMlrResponse(Coap::Message *aMessage, const Ip6::MessageInfo *aMessageInfo, Error aResult);
|
||||
static Error ParseMlrResponse(Error aResult,
|
||||
Coap::Message *aMessage,
|
||||
@@ -170,8 +170,8 @@ private:
|
||||
static void HandleRegisterResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult);
|
||||
void HandleRegisterResponse(otMessage *aMessage, const otMessageInfo *aMessageInfo, Error aResult);
|
||||
otError aResult);
|
||||
void HandleRegisterResponse(otMessage *aMessage, const otMessageInfo *aMessageInfo, otError aResult);
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLR_ENABLE
|
||||
|
||||
@@ -246,7 +246,10 @@ void Notifier::HandleNotifierEvents(Events aEvents)
|
||||
|
||||
void Notifier::HandleTimer(void) { SynchronizeServerData(); }
|
||||
|
||||
void Notifier::HandleCoapResponse(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo, Error aResult)
|
||||
void Notifier::HandleCoapResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
otError aResult)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aMessage);
|
||||
OT_UNUSED_VARIABLE(aMessageInfo);
|
||||
|
||||
@@ -135,7 +135,7 @@ private:
|
||||
static void HandleCoapResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult);
|
||||
otError aResult);
|
||||
void HandleCoapResponse(Error aResult);
|
||||
|
||||
#if OPENTHREAD_CONFIG_BORDER_ROUTER_SIGNAL_NETWORK_DATA_FULL
|
||||
|
||||
@@ -625,7 +625,10 @@ void Server::SendNextAnswer(Coap::Message &aAnswer, const Ip6::Address &aDestina
|
||||
}
|
||||
}
|
||||
|
||||
void Server::HandleAnswerResponse(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo, Error aResult)
|
||||
void Server::HandleAnswerResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
otError aResult)
|
||||
{
|
||||
Coap::Message *nextAnswer = static_cast<Coap::Message *>(aContext);
|
||||
|
||||
@@ -935,7 +938,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
void Client::HandleGetResponse(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo, Error aResult)
|
||||
void Client::HandleGetResponse(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo, otError aResult)
|
||||
{
|
||||
static_cast<Client *>(aContext)->HandleGetResponse(AsCoapMessagePtr(aMessage), AsCoreTypePtr(aMessageInfo),
|
||||
aResult);
|
||||
|
||||
@@ -209,7 +209,7 @@ private:
|
||||
static void HandleAnswerResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult);
|
||||
otError aResult);
|
||||
void HandleAnswerResponse(Coap::Message &aNextAnswer,
|
||||
Coap::Message *aResponse,
|
||||
const Ip6::MessageInfo *aMessageInfo,
|
||||
@@ -316,7 +316,7 @@ private:
|
||||
static void HandleGetResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult);
|
||||
otError aResult);
|
||||
void HandleGetResponse(Coap::Message *aMessage, const Ip6::MessageInfo *aMessageInfo, Error aResult);
|
||||
|
||||
template <Uri kUri> void HandleTmf(Coap::Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
|
||||
|
||||
@@ -180,7 +180,7 @@ void ChannelManager::StartDatasetUpdate(void)
|
||||
}
|
||||
}
|
||||
|
||||
void ChannelManager::HandleDatasetUpdateDone(Error aError, void *aContext)
|
||||
void ChannelManager::HandleDatasetUpdateDone(otError aError, void *aContext)
|
||||
{
|
||||
static_cast<ChannelManager *>(aContext)->HandleDatasetUpdateDone(aError);
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ private:
|
||||
|
||||
#if OPENTHREAD_FTD
|
||||
void StartDatasetUpdate(void);
|
||||
static void HandleDatasetUpdateDone(Error aError, void *aContext);
|
||||
static void HandleDatasetUpdateDone(otError aError, void *aContext);
|
||||
void HandleDatasetUpdateDone(Error aError);
|
||||
#endif
|
||||
void HandleTimer(void);
|
||||
|
||||
@@ -110,7 +110,7 @@ exit:
|
||||
void MeshDiag::HandleDiagGetResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult)
|
||||
otError aResult)
|
||||
{
|
||||
static_cast<MeshDiag *>(aContext)->HandleDiagGetResponse(AsCoapMessagePtr(aMessage), AsCoreTypePtr(aMessageInfo),
|
||||
aResult);
|
||||
|
||||
@@ -291,7 +291,7 @@ private:
|
||||
static void HandleDiagGetResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
Error aResult);
|
||||
otError aResult);
|
||||
|
||||
using TimeoutTimer = TimerMilliIn<MeshDiag, &MeshDiag::HandleTimer>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user